$(document).ready(function() { athenspartyrnb_RefreshTitleArtist(); }); function addTimeStamp(){ tstmp = new Date(); return tstmp.getTime(); } function athenspartyrnb_RefreshTitleArtist() { $.ajax({ type: "GET", url: "/whatson/athenspartyrnb/NowOnAir.xml?timestamp="+addTimeStamp(), dataType: "xml", success: athenspartyrnb_ShowTitleArtist }); } function athenspartyrnb_ShowTitleArtist(xml) { $(xml).find("Song").each(function() { $("#athenspartyrnbTitle").html($(this).attr("title")); $(xml).find("Artist").each(function() { $("#athenspartyrnbArtist").html($(this).attr("name")); }); }); } var oRefreshathenspartyrnb; oRefreshathenspartyrnb = window.setInterval("athenspartyrnb_RefreshTitleArtist()", 50000);