I need an example of AJAX that returns the output of a php script and auto refreshes?
Has anyone got such a script?
I just need it to run a php script/file and return the output to the page say every 10 seconds?
Cheers
July 31, 2010 | Filed Under Scripts FAQs
Comments
One Response to “I need an example of AJAX that returns the output of a php script and auto refreshes?”
Powered by Yahoo! Answers
Google for "Sajax" (AJAX for php, very efficient and easy to use).
To refresh every 10 secs:
<script>
setTimeout ( "refresh_me ( )", 10000 );
function refresh_me()
{
sajax_target_id = ‘id_to_refresh’;
x_p_refresh_me ( );
sajax_target_id = ”;
setTimeout ( "refresh_me ( )", 10000 );
}
</script>
<?php
function p_refresh_me()
{
do something;
return (something);
}
?>