We just added a JSON formatted feed for recent tracks to make manipulation with JavaScript easier. The JSON feeds work lust like the recent tracks feeds:

Full feed: http://zenradar.roblogic.net/service/1.0/user/[username]/recenttracks.json
Specify number of results (1-10): http://zenradar.roblogic.net/service/1.0/user/[username]/recenttracks_[1-10].json

Here's the easy way to cache the feed on your site. Run this script from cron on a regular basis, then pull the cached file in your JavaScript to keep things snappy.
<?php
//from marc2003's script on last.fm forum
$user 'roblogic'//last.fm username

$remotefile "http://zenradar.roblogic.net/service/1.0/user/$user/
recenttracks.json"
;
$localfile $user.'.json';

try
{    
    
$ch curl_init($remotefile);
    
$fp fopen($localfile"w");
    
    
curl_setopt($chCURLOPT_FILE$fp);
    
curl_setopt($chCURLOPT_HEADER0);
    
    
curl_exec($ch);
    
curl_close($ch);
    
fclose($fp);

}
catch (
Exception $e)
{
    echo 
$e->getMessage();
    echo 
'<pre>';
    echo 
$e->getTraceAsString();
    echo 
'</pre>';
}