$(document).ready(function() { arionlaikos_RefreshTitleArtist(); }); function addTimeStamp(){ tstmp = new Date(); return tstmp.getTime(); } function arionlaikos_RefreshTitleArtist() { $.ajax({ type: "GET", url: "/whatson/arionlaikos/NowOnAir.xml?timestamp="+addTimeStamp(), dataType: "xml", success: arionlaikos_ShowTitleArtist }); } function arionlaikos_ShowTitleArtist(xml) { $(xml).find("Song").each(function() { $("#arionlaikosTitle").html($(this).attr("title")); $(xml).find("Artist").each(function() { $("#arionlaikosArtist").html($(this).attr("name")); }); }); } var oRefresharionlaikos; oRefresharionlaikos = window.setInterval("arionlaikos_RefreshTitleArtist()", 50000);