$(document).ready(function() { eurovisionfm_RefreshTitleArtist(); }); function addTimeStamp(){ tstmp = new Date(); return tstmp.getTime(); } function eurovisionfm_RefreshTitleArtist() { $.ajax({ type: "GET", url: "/whatson_remote/updateNowOnAir.asp?sid=4×tamp="+addTimeStamp(), dataType: "xml", success: eurovisionfm_ShowTitleArtist }); } function eurovisionfm_ShowTitleArtist(xml) { $(xml).find("Song").each(function() { $("#eurovisionfmTitle").html($(this).attr("title")); $(xml).find("Artist").each(function() { $("#eurovisionfmArtist").html($(this).attr("name")); }); }); } var oRefresheurovisionfm; oRefresheurovisionfm = window.setInterval("eurovisionfm_RefreshTitleArtist()", 50000);