Window.setTimeout() MethodNameWindow.setTimeout() Method---defer execution of codeAvailabilityNavigator 2.0, Internet Explorer 3.0 Synopsis
window.setTimeout(code, delay) Arguments
ReturnsAn opaque value (a "timeout id") that can be passed to the clearTimeout() method to cancel the execution of code. DescriptionThe setTimeout() method defers the execution of the JavaScript statements in the string code for delay milliseconds. Once the specified number of milliseconds have elapsed, the statements in code are executed normally. Note that they are executed only once. To execute code repeatedly, code must itself contain a call to setTimeout() to register itself to be executed again. The statement in the string code are executed in the context of window--i.e., window will be the current window for those statements. If more than one statement appears in code, the statements must be separated from each other with semicolons. BugsIn Navigator 2.0 memory allocated by JavaScript is not freed until the browser leaves a web page. Each call to setTimeout() consumes some memory, and the deferred code generally consumes memory as well. Thus, if a page performs some sort of infinite loop (for example, a status-bar animation using Window.setTimeout() and Window.status), then memory will slowly be consumed, and Navigator may crash if the user remains on the page for a long time. |
|