$(document).ready(function() { RefreshTitlesBREEZE(); }); function addTimeStamp(){ tstmp = new Date(); return tstmp.getTime(); } function RefreshTitlesBREEZE() { $.ajax({ type: "GET", url: "/whatson/akousbreeze/NowOnAir.xml?timestamp="+addTimeStamp(), dataType: "xml", success: ShowTitleArtistBREEZE }); $.ajax({ type: "GET", url: "/whatson/akousbreeze/AirPlayNext.xml?timestamp="+addTimeStamp(), dataType: "xml", success: ShowNextSongsBREEZE }); } function ShowTitleArtistBREEZE(xml) { $(xml).find("Song").each(function() { $("#BREEZE_title").html($(this).attr("title")); $(xml).find("Artist").each(function() { $("#BREEZE_artist").html($(this).attr("name")); }); }); } function ShowNextSongsBREEZE(xml) { var j=0; $(xml).find("Song").each(function() { if (j==0 ){ $("#BREEZE_nexttitle").html( $(this).attr("title") ); $("#BREEZE_nextartist").html( $(this).find("Artist").attr("name") ); } j=j+1; }); } var oRefreshBREEZE; oRefreshBREEZE = window.setInterval("RefreshTitlesBREEZE()", 50000);