Setinterval Method
Evaluates an expression each time a specified number of milliseconds has
Elapsed.
Syntax
Itimerid
=Window
. Setinterval (
Vcode
,
Imilliseconds
[
,
Slanguage
]
)
Parameters
Vcode
|
Required.Variant That specifies a function pointer or string that Indicates the code to be executed when the specified interval has Elapsed. |
Imilliseconds
|
Required.Integer That specifies the number Milliseconds. |
Slanguage
|
Optional.String That specifies any one of the possible values The language Attribute. |
Return Value
Integer. returns an identifier that cancels the timer withClearinterval
Method.
Remarks
TheSetinterval
Method continuously evaluates the specified expression
Until the timer is removed withClearinterval
Method.
In versions earlier than Microsoft Internet Explorer 5, the first argument
OfSetinterval
Must be a string. Evaluation of the string is deferred
Until the specified interval elapses.
As of Internet Explorer 5, the first argumentSetinterval
Can be
Passed as a string or as a function pointer.
To pass a function as a string, be sure to suffix the function name
Parentheses.
window.setInterval("someFunction()", 5000);
When passing a function pointer, do not include the parentheses.
window.setInterval(someFunction, 5000);
Evaluates an expression after a specified number of milliseconds has elapsed.
Syntax
Itimerid
=Window
. SetTimeout (
Vcode
,
Imilliseconds
[
,
Slanguage
]
)
Parameters
Vcode
|
Required.Variant That specifies the function pointer or string that Indicates the code to be executed when the specified interval has Elapsed. |
Imilliseconds
|
Required.Integer That specifies the number Milliseconds. |
Slanguage
|
Optional.String That specifies one of the following values:
JScript
|
Language is JScript. |
VBScript
|
Language is VBScript. |
Javascript
|
Language is JavaScript. |
|
Return Value
Integer. returns an identifier that cancels the evaluation withCleartimeout
Method.
Remarks
In versions earlier than Microsoft Internet Explorer 5, the first argument
OfSetTimeout
Must be a string. Evaluation of the string is deferred
Until the specified interval elapses.
As of Internet Explorer 5, the first argumentSetTimeout
Can be
String or a function pointer.
The specified expression or function is evaluatedOnce
.Repeated
Evaluation, useSetinterval
Method.