Sent: Tuesday, February 15, 2000 4:04 PM
To: [email protected]
Subject: Active Server Developer Tips, 02/16/2000
Repeatedly call a JScript function with setInterval()
Both Internet Explorer and Netscape Navigator offer a new
JavaScript function with which you can repeatedly call a function
at a set interval -- the setInterval() function. This function
is only available in 4.0+ browsers, and conforms to the
following syntax:
setInterval("myFunctionName", milliSecs)
As you can see, the first argument is the name of the function
you wish to repeat, and the second argument contains the delay,
in milliseconds, between each call. So, for example, to run the
function myFunction() every five seconds, you'd use
setInterval("myFunction()", 5000)
This function returns an id number that you use in conjunction
with clearInterval() to stop execution, as in
var myID = setInterval("myFunction()", 5000)
clearInterval(myID)