$(document).ready(function() { velvetfm_RefreshTitleArtist(); }); function addTimeStamp(){ tstmp = new Date(); return tstmp.getTime(); } function velvetfm_RefreshTitleArtist() { $.ajax({ type: "GET", url: "/whatson/velvetfm/NowOnAir.xml?timestamp="+addTimeStamp(), dataType: "xml", success: velvetfm_ShowTitleArtist }); } function velvetfm_ShowTitleArtist(xml) { $(xml).find("Song").each(function() { $("#velvetfmTitle").html($(this).attr("title")); $(xml).find("Artist").each(function() { $("#velvetfmArtist").html($(this).attr("name")); }); }); } var oRefreshvelvetfm; oRefreshvelvetfm = window.setInterval("velvetfm_RefreshTitleArtist()", 50000);