Availability
JavaScript 1.0
Synopsis
window.setTimeout(code, delay)
Arguments
code
A string that contains the JavaScript code to be executed after the
delay has elapsed.
delay
The amount of time, in milliseconds, before the JavaScript statements
in the string code should be executed.
Returns
An opaque value ("timeout id") that can be passed to the
clearTimeout( ) method to cancel the execution of
code.
Description
The setTimeout(
) method defers the execution of the JavaScript statements
in the string code for
delay milliseconds. Once the specified
number of milliseconds has 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. In JavaScript 1.2, you can use Window.setInterval(
) to register code that is executed at periodic intervals.
The statements in the string code are
executed in the context of window; i.e.,
window is the current window for those
statements. If more than one statement appears in
code, the statements must be separated by
semicolons.
See Also
Window.clearTimeout( ), Window.setInterval( )
•
Table of Contents
•
Index
•
Reviews
•
Examples
•
Reader Reviews
•
Errata
JavaScript: The Definitive Guide, 4th Edition
By
David Flanagan
Publisher
: O'Reilly
Pub Date
: November 2001
ISBN
: 0-596-00048-0
Pages
: 936
Slots
: 1
This fourth edition of the definitive reference to
JavaScript, a scripting language that can be embedded
directly in web pages, covers the latest version of the
language, JavaScript 1.5, as supported by Netscape 6 and
Internet Explorer 6. The book also provides complete
coverage of the W3C DOM standard (Level 1 and Level 2),
while retaining material on the legacy Level 0 DOM for
backward compatibility.