PDA

View Full Version : Calling a PHP function with Ajax every 20 secs


telmessos
12-03-2009, 03:44 PM
Hi,

I have a PHP function and I want an Ajax script which will call the function every 20 secs once the page is loaded. I need to refresh the content of a specific part of my page and I don't want to use iframe + refresh. I will be glad if you could help. While replying, please consider that I am beginner in both Ajax and PHP.

Regards
telmessos

P.S. : Wrote this before in PHP section.

Spudhead
12-04-2009, 01:49 PM
Are you familiar with the Prototype (http://www.prototypejs.org/)library, or with jQuery (http://jquery.com/)? Prototype has an inbuilt PeriodicalUpdater (http://www.prototypejs.org/api/ajax/periodicalUpdater) object. If you prefer to use jQuery, there are one or two plugins (http://github.com/RobertFischer/JQuery-PeriodicalUpdater/)available that emulate its functionality.