Basic HTML version of Foils prepared 23 June 1997

Foil 64 Timeout Example - I

From JavaScript Tutorial for Certificate Course UC Web applications Certificate -- Summer 97. by Geoffrey C. Fox, Tom Scavo


1 <SCRIPT LANGUAGE="JavaScript">
2 var timerID = null; // setTimeout handle
3 var running = false;
4 function stopclock() {
  • if ( running ) clearTimeout(timerID);
  • running = false;
5 }
6 function startclock() {
  • stopclock(); showtime();
7 }
8 function showtime() {
  • // Calculate and display current time:
  • document.clock.face.value = timeValue;
  • // Timeout for one second:
  • timerID = setTimeout("showtime()", 1000);
  • running = true;
9 }
10 </SCRIPT>

in Table To:


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 Apr 1 1998