I want to observe the existence of a file with ajax. At the moment I have a refresh button, I have to press to refresh the status. I want to automate this refresh.
+2
A:
Look into javascript's setTimeout()
and setInterval()
setInterval ( "doSomething()", 5000 );
function doSomething ( )
{
// Put your AJAX in here
// It will be called every 5 seconds
}
jakenoble
2010-09-07 08:16:32
thank you.. i tried it with setTimeout() but then i had problems with the browser.. setInterval works fine..
elr
2010-09-07 08:26:25