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.
@Specht08Dec 03.2009 — #[CODE]setTimeout(function() { [yourajaxrequest] }, 20000); [/CODE] Us the Timeout function of Javascript. The unit of the last attribute is milliseconds
@Specht08Dec 03.2009 — #Sorry if forgot that you want to call it every 20 seconds. This would do the trick: [CODE] function asd(){ [yourajaxrequest] setTimeout('asd()', 20000); } [/CODE] Your on load function also contains setTimeout('asd()', 20000);
@telmessosauthorDec 03.2009 — #hi thanks for reply. my ajax request is calling a php function. all I want to do is just calling a PHP function called getcur(). I am a beginner AJAX coder. So please write me in "... For Dummies" style if possible.
@telmessosauthorDec 04.2009 — #I don't know what ajax script to write. by saying "my ajax script" I meant "I need a script like that". that's the point ?