Refreshing the php output without realoading the page

dasnov

New Member
The php script parses xml file and print output on page inside div: \[code\]<?php$playlistUrl = 'http://url/to/playlist.xml';$xmldata = http://stackoverflow.com/questions/10564692/file_get_contents($playlistUrl);$xml = new SimpleXMLElement($xmldata);foreach( $xml->trackList->track as $track ) { echo $track->title .' - '. $track->annotation .'<br>';}?>\[/code\]I want to update the output every 25sec without reloading the page, using some AJAX method. I find some code samples that set time interval: \[code\]// Poll the server each 60 secondswindow.setInterval(function() }, 60000);\[/code\]also\[code\]setInterval(function(){SomeAjaxFunction();}, 1000);\[/code\]How to implement this properly in my case?
 
Back
Top