Is there a way to have a background refresh of some php scripts i have already provided.. I just want these scripts to refresh every 5 seconds so that i would be able to record/view dynamic data..
iam using this on the header of my site:
sample url http://www.example.com/scripts
setTimeout('window.location="/scripts";',5000);
But the after refresh it goes to the url..I just want it to be refreshed(updated) without redirecting to it.. Is it possible?Some sample?..
Best Regards..
try this with jQuery:
$('body').load( url,[data],[callback] );
Read more at docs.jquery.com / Ajax / load
The best method of using this is using AJAX and having a php file which would change those variables. This way you do not have to refresh the page but just ask the server for an update. On the completed
callback change what you have to change on the client based on the response of the server. You have plenty of AJAX tutorials on the web.