最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

setInterval Method

Internet Development Index

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爐hat specifies the number of milliseconds.
sLanguage Optional. String爐hat specifies any one of the possible values for the LANGUAGE attribute.

Return Value

Integer. Returns an identifier that cancels the timer with the clearInterval method.

Remarks

The setInterval method continuously evaluates the specified expression until the timer is removed with the clearInterval method.

In versions earlier than Microsoft® Internet Explorer 5, the first argument of setInterval must be a string. Evaluation of the string is deferred until the specified interval elapses.

As of Internet Explorer 5, the first argument of setInterval 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 with parentheses.

window.setInterval("someFunction()", 5000);

When passing a function pointer, do not include the parentheses.

window.setInterval(someFunction, 5000);

To retrieve a function pointer, use the code shown in the following example:

function callback()
{
alert("callback");
}
function callback2()
{
alert("callback2");
}
function chooseCallback(iChoice)
{
switch (iChoice)
{
case 0:
return callback;
case 1:
return callback2;
default:
return "";
}
}
// if i is 0, callback is invoked after 5 seconds
// if i is 1, callback2 is invoked
// otherwise, the timer is not set
window.setInterval(chooseCallback(i), 5000);

When you use the setInterval method with Introduction to DHTML Behaviors, the value of vCode should be a function pointer to call a function within the HTML Component (HTC) file or a string to call a function in the primary document.

Example

This example uses the setInterval method to create a Dynamic HTML (DHTML) clock. A variable is assigned to the interval, and can be used as a reference to stop the interval using the clearInterval method.

var oInterval = "";
function fnStartInterval(){
oInterval = window.setInterval("fnRecycle()",1000);
}
function fnRecycle(){
// Code to display hours, minutes, and seconds.
}
This feature requires Microsoft® Internet Explorer 4.0 or later. Click the following icon to install the latest version. Then reload this page to view the sample.

Standards Information

There is no public standard that applies to this method.

Applies To

window

See Also

clearInterval, setTimeout, setTimeout
防城港市| 广南县| 灵台县| 长治市| 博白县| 大同市| 华安县| 五莲县| 佛冈县| 金塔县| 海南省| 蒙山县| 城固县| 清原| 资源县| 浪卡子县| 白沙| 平山县| 乌海市| 河西区| 杭锦后旗| 交口县| 大港区| 湖南省| 枣庄市| 永济市| 陵川县| 文登市| 遵义县| 池州市| 永善县| 尤溪县| 黄浦区| 京山县| 高邮市| 彩票| 丰原市| 英德市| 阿克陶县| 义马市| 出国|