$(document).ready(function() { arionchristmas_RefreshTitleArtist(); }); function addTimeStamp(){ tstmp = new Date(); return tstmp.getTime(); } function arionchristmas_RefreshTitleArtist() { $.ajax({ type: "GET", url: "/whatson/arionchristmas/NowOnAir.xml?timestamp="+addTimeStamp(), dataType: "xml", success: arionchristmas_ShowTitleArtist }); } function arionchristmas_ShowTitleArtist(xml) { $(xml).find("Song").each(function() { $("#arionchristmasTitle").html($(this).attr("title")); $(xml).find("Artist").each(function() { $("#arionchristmasArtist").html($(this).attr("name")); }); }); } var oRefresharionchristmas; oRefresharionchristmas = window.setInterval("arionchristmas_RefreshTitleArtist()", 50000);