$(document).ready(function() { akousdreams_RefreshTitleArtist(); }); function addTimeStamp(){ tstmp = new Date(); return tstmp.getTime(); } function akousdreams_RefreshTitleArtist() { $.ajax({ type: "GET", url: "/whatson/akousdreams/NowOnAir.xml?timestamp="+addTimeStamp(), dataType: "xml", success: akousdreams_ShowTitleArtist }); } function akousdreams_ShowTitleArtist(xml) { $(xml).find("Song").each(function() { $("#akousdreamsTitle").html($(this).attr("title")); $(xml).find("Artist").each(function() { $("#akousdreamsArtist").html($(this).attr("name")); }); }); } var oRefreshdreams; oRefreshdreams = window.setInterval("akousdreams_RefreshTitleArtist()", 50000);