HELP! * YELLOW=global GREY=local Global HTML version of Foils prepared 21 February 97

Foil 63 setTimeout and clearTimeout

From Feb 17/19 Delivered Lecture for Course CPS616 -- aJavaScript Language Objects and Frames CPS616 spring 1997 -- Feb 17 and 19 1997. by Geoffrey Fox * Important Information in IMAGE
Secs 96.4 Addon
These are methods of a given window or frame
yourID = setTimeout(JSexp, timeinmsecs);
sets yourID to a handle which can be used in
clearTimeout(yourID); // which completely clears what was started by setTimeout
setTimeout starts a timer which causes JavaScript expression JSexp to be evaluated after a time interval of timeinmsecs which is expressed in milliseconds
Time outs can be used to animate text or images and make a display change at after a given interval
  • Also to start a daemon monitoring whats going on!
Note setTimeout does not start a LOOP -- just a single timing.
Thus clearTimeout need NOT be called unless you want abnormal termination
Further if you want a loop, please ensure JSexp restarts a new setTimeout


Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Fri Feb 21 1997