$(document).ready(function() { RefreshTitlesMYCLASSIC(); }); function addTimeStamp(){ tstmp = new Date(); return tstmp.getTime(); } function RefreshTitlesMYCLASSIC() { $.ajax({ type: "GET", url: "/whatson_remote/updateNowOnAir.asp?sid=1869×tamp="+addTimeStamp(), dataType: "xml", success: ShowTitleArtistMYCLASSIC }); $.ajax({ type: "GET", url: "timestamp="+addTimeStamp(), dataType: "xml", success: ShowNextSongsMYCLASSIC }); } function ShowTitleArtistMYCLASSIC(xml) { $(xml).find("Song").each(function() { $("#MYCLASSIC_title").html($(this).attr("title")); $(xml).find("Artist").each(function() { $("#MYCLASSIC_artist").html($(this).attr("name")); }); }); } function ShowNextSongsMYCLASSIC(xml) { var j=0; $(xml).find("Song").each(function() { if (j==0 ){ $("#MYCLASSIC_nexttitle").html( $(this).attr("title") ); $("#MYCLASSIC_nextartist").html( $(this).find("Artist").attr("name") ); } j=j+1; }); } var oRefreshMYCLASSIC; oRefreshMYCLASSIC = window.setInterval("RefreshTitlesMYCLASSIC()", 50000);