AvailabilityJavaScript 1.2; IE 4 supports only one of the two forms Synopsiswindow.setInterval(code, interval) window.setInterval(func, interval,args...) Arguments
ReturnsA value that can be passed to Window.clearInterval( ) to cancel the periodic execution of code or func. DescriptionsetInterval( ) repeatedly executes the JavaScript statements specified in the string code, at intervals of interval milliseconds. In Netscape 4, but not IE 4, a function may be passed as the first argument instead of a string. In this form of setInterval( ), the specified function, func, is repeatedly invoked, at intervals of interval milliseconds. Any additional argument values, args, passed to setInterval( ) are passed as arguments to each invocation of func( ). In both forms, the setInterval( ) method returns a value that can later be passed to Window.clearInterval( ) to stop code or func from being repeatedly executed. setInterval( ) is related to setTimeout( ). Use setTimeout( ) when you want to defer the execution of code but do not want it to be repeatedly executed. See AlsoWindow.clearInterval( ), Window.setTimeout( ) |