$(document).ready(function() { RefreshTitlesRODON(); }); function addTimeStamp(){ tstmp = new Date(); return tstmp.getTime(); } function RefreshTitlesRODON() { $.ajax({ type: "GET", url: "/whatson/akousbreeze/NowOnAir.xml?timestamp="+addTimeStamp(), dataType: "xml", success: ShowTitleArtistRODON }); $.ajax({ type: "GET", url: "/whatson/akousbreeze/AirPlayNext.xml?timestamp="+addTimeStamp(), dataType: "xml", success: ShowNextSongsRODON }); } function ShowTitleArtistRODON(xml) { $(xml).find("Song").each(function() { $("#RODON_title").html($(this).attr("title")); $(xml).find("Artist").each(function() { $("#RODON_artist").html($(this).attr("name")); }); }); } function ShowNextSongsRODON(xml) { var j=0; $(xml).find("Song").each(function() { if (j==0 ){ $("#RODON_nexttitle").html( $(this).attr("title") ); $("#RODON_nextartist").html( $(this).find("Artist").attr("name") ); } j=j+1; }); } var oRefreshRODON; oRefreshRODON = window.setInterval("RefreshTitlesRODON()", 50000);