HELP! * GREY=local LOCAL HTML version of Foils prepared 15 January 1997

Foil 60 setTimeout and clearTimeout

From JavaScript Tutorial for CPS616 Technologies of the Information Age 1997 Basic Information Track of CPS -- Spring Semester 97. by Geoffrey C. Fox * See also color IMAGE
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 Wed Feb 19 1997