More Questions Than Answers

Dan Atrill's blog site

JavaScript time outs

Sometimes it’s necessary to repeat an action in JavaScript to check if something’s updated since last time the function was called:
window.setInterval(“goAjax()”,1000);
Sometimes things don’t immediately update in a browser so you may need to delay a function call using something like this:
var bVal = setInterval(“buttonValid();”,500);
and
clearInterval(bVal);
Functions/statements must be in quotes. Timings are in milliseconds.
Using setInterval() to Make a JavaScript Listener explains what this means and how to set and clear intervals.

Thu, August 9 2007 » Web developing

Leave a Reply