A Timeout Processing Example : Timer : Development : JavaScript DHTML examples (example source code) Organized by topic

JavaScript DHTML
C++
PHP
JavaScript DHTML Home »  Development   » [  Timer  ]   
 



A Timeout Processing Example

Please note that some example is only working under IE or Firefox.


/*
Mastering JavaScript, Premium Edition
by James Jaworski 

ISBN:078212819X
Publisher Sybex CopyRight 2001
*/
<HTML>
<HEAD>
<TITLE>Timeout Program</TITLE>
<SCRIPT LANGUAGE="JavaScript"><!--
function setTimer() {
 timer=setTimeout("alert('Too slow!')",10000)
}
function clearTimer() {
 clearTimeout(timer)
 alert("Congratulations!")
}
// --></SCRIPT>
</HEAD>
<BODY>
<SCRIPT LANGUAGE="JavaScript"><!--
setTimer()
// --></SCRIPT>
<FORM>
<INPUT TYPE="BUTTON" VALUE="Click here within ten seconds."
 ONCLICK="clearTimer()">
</FORM>
</BODY>
</HTML>

           
       
Related examples in the same category
1.  Count down timer
2.  Using a Timer
3.  setInterval() and clearInterval() methods
4.  A Countdown Timer
5.  Timer Events Demo
6.  Timer Events Demo 2
7.   Accessing Document Contents
8.  Using the const Keyword
























Home| Contact Us
Copyright 2003 - 04 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.