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


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



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