$(document).ready(function() { akousgazi_RefreshTitleArtist(); }); function addTimeStamp(){ tstmp = new Date(); return tstmp.getTime(); } function akousgazi_RefreshTitleArtist() { $.ajax({ type: "GET", url: "/whatson/akousgazi/NowOnAir.xml?timestamp="+addTimeStamp(), dataType: "xml", success: akousgazi_ShowTitleArtist }); } function akousgazi_ShowTitleArtist(xml) { $(xml).find("Song").each(function() { $("#akousgaziTitle").html($(this).attr("title")); $(xml).find("Artist").each(function() { $("#akousgaziArtist").html($(this).attr("name")); }); }); } var oRefreshgazi; oRefreshgazi = window.setInterval("akousgazi_RefreshTitleArtist()", 50000);