Evaluates an expression after a specified number of milliseconds has elapsed.



iTimerID = window.setTimeout(vCode, iMilliSeconds [, sLanguage])


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 of 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 with the clearTimeout method.




setTimeout( alert(“3秒种过去了"), 3000);//调用一个函数,允许带常量参数<br />


不同的是setTimeout()是一次性作用,而setInterval()是每隔<em>iMilliSeconds就执行一次<em>vCode.(Evaluates an expression each time a specified number of milliseconds has elapsed)

Leave a Reply

电子邮件地址不会被公开。 必填项已用*标注