Re: Page Refresh Timed Event
The Javascript function setTimeout is what you are looking for.
Let's say that your check function is called check(), and you want to run
this function every three seconds, the appropriate code would be:
while(true)
{
setTimeout("check()",3000);
}
This will call check() approx. every 3000 milliseconds (3 seconds).
If check() requires arguments, the code looks like this:
while(true)
{
setTimeout("check()",3000,arg1,arg2,etc);
}
Good luck. Make sure you break out of the while loop when you find the record
you are looking for.
"sanders" <cartier_eric@hotmail.com> wrote:
>
>Hi all,
>
>I'm working with an E-business app that uses servlets. I need a JavaScript
>for a piece of functionality. I am checking a database to see if there
is
>a new record. What I need is for it to keep checkig every X seconds (X
to
>be feed to the JavaScript) once the time is reached it needs to call my
check
>method. Any ideas would be great.
>
>Thanks!!!