$(document).ready(function() { arionradio_RefreshTitleArtist(); }); function addTimeStamp(){ tstmp = new Date(); return tstmp.getTime(); } function arionradio_RefreshTitleArtist() { $.ajax({ type: "GET", url: "/whatson/arionradio/NowOnAir.xml?timestamp="+addTimeStamp(), dataType: "xml", success: arionradio_ShowTitleArtist }); } function arionradio_ShowTitleArtist(xml) { $(xml).find("Song").each(function() { $("#arionradioTitle").html($(this).attr("title")); $(xml).find("Artist").each(function() { $("#arionradioArtist").html($(this).attr("name")); }); }); } var oRefresharionradio; oRefresharionradio = window.setInterval("arionradio_RefreshTitleArtist()", 50000);