$(document).ready(function() { RefreshTitlesPALKO(); }); function addTimeStamp(){ tstmp = new Date(); return tstmp.getTime(); } function RefreshTitlesPALKO() { $.ajax({ type: "GET", url: "https://onair.e-radio.gr/whatson/akous/akousPalko/NowOnAir.xml?timestamp="+addTimeStamp(), dataType: "xml", success: ShowTitleArtistPALKO }); $.ajax({ type: "GET", url: "https://onair.e-radio.gr/whatson/akous/akousPalko/AirPlayNext.xml?timestamp="+addTimeStamp(), dataType: "xml", success: ShowNextSongsPALKO }); } function ShowTitleArtistPALKO(xml) { $(xml).find("Song").each(function() { $("#PALKO_title").html($(this).attr("title")); $(xml).find("Artist").each(function() { $("#PALKO_artist").html($(this).attr("name")); }); }); } function ShowNextSongsPALKO(xml) { var j=0; $(xml).find("Song").each(function() { if (j==0 ){ $("#PALKO_nexttitle").html( $(this).attr("title") ); $("#PALKO_nextartist").html( $(this).find("Artist").attr("name") ); } j=j+1; }); } var oRefreshPALKO; oRefreshPALKO = window.setInterval("RefreshTitlesPALKO()", 50000);