tailieunhanh - JavaScript Bible, Gold Edition part 180

JavaScript Bible, Gold Edition part 180. This book will bring programmers and non-technical professionals, including casual programmers and scripters, painlessly up to speed on all aspects of mastering JavaScript. Key topics include programming fundamentals, JavaScript language elements and how to use them effectively, and how to easily and efficiently add powerful new functionality to HTML documents and Java applets. | CD-282 Part VI Appendixes Listing 16-21 continued red setTimeoutC white 500 let event continue to target routeEvent e default setting to capture click events assign flash function to click events captured by window flash SCRIPT HEAD BODY BGCOLOR white FORM NAME buttons B Turn window click event capture on or off Default is On B P INPUT NAME captureOn TYPE button VALUE Capture On onClick nbsp INPUT NAME captureOff TYPE button VALUE Capture Off onClick HR B Ctrl Click on a button to see if clicks are being captured by the window background color will flash red B P UL LI INPUT NAME button1 TYPE button VALUE Informix onClick alert You clicked on Informix. LI INPUT NAME button2 TYPE button VALUE Oracle onClick alert You clicked on Oracle. LI INPUT NAME button3 TYPE button VALUE Sybase onClick alert You clicked on Sybase. UL FORM BODY HTML When you try this page also turn off window event capture. Now only the buttons onClick event handlers execute and the page does not flash red. clearInterval intervallDnumber NN2 NN3 NN4 NN6 IE3 J1 IE3 J2 IE4 IE5 Compatibility w ndowO6 Appendix F Examples from Parts III and IV CD-283 Example See Listings 16-36 and 16-37 for an example of how setInterval and clearInterval are used together on a page. clearTimeout timeoutlDnumber NN2 NN3 NN4 NN6 IE3 J1 IE3 J2 IE4 IE5 Compatibility Example The page in Listing 16-22 features one text field and two buttons Figure 16-11 . One button starts a countdown timer coded to last one minute easily modifiable for other durations the other button interrupts the timer at any time while it is running. When the minute is up an alert dialog box lets you know. Listing 16-22 A Countdown Timer HTML HEAD TITLE Count Down Timer TITLE SCRIPT LANGUAGE JavaScript -- var running false var endTime null var timerlD null function startTimer .

TỪ KHÓA LIÊN QUAN