$(document).ready(function() { athensparty_RefreshTitleArtist(); }); function addTimeStamp(){ tstmp = new Date(); return tstmp.getTime(); } function athensparty_RefreshTitleArtist() { $.ajax({ type: "GET", url: "/whatson/athensparty/NowOnAir.xml?timestamp="+addTimeStamp(), dataType: "xml", success: athensparty_ShowTitleArtist }); } function athensparty_ShowTitleArtist(xml) { $(xml).find("Song").each(function() { $("#athenspartyTitle").html($(this).attr("title")); $(xml).find("Artist").each(function() { $("#athenspartyArtist").html($(this).attr("name")); }); }); } var oRefreshathensparty; oRefreshathensparty = window.setInterval("athensparty_RefreshTitleArtist()", 50000);