$(document).ready(function() { arionkids_RefreshTitleArtist(); }); function addTimeStamp(){ tstmp = new Date(); return tstmp.getTime(); } function arionkids_RefreshTitleArtist() { $.ajax({ type: "GET", url: "/whatson/arionkids/NowOnAir.xml?timestamp="+addTimeStamp(), dataType: "xml", success: arionkids_ShowTitleArtist }); } function arionkids_ShowTitleArtist(xml) { $(xml).find("Song").each(function() { $("#arionkidsTitle").html($(this).attr("title")); $(xml).find("Artist").each(function() { $("#arionkidsArtist").html($(this).attr("name")); }); }); } var oRefresharionkids; oRefresharionkids = window.setInterval("arionkids_RefreshTitleArtist()", 50000);