Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
JavaScript Bible, Gold Edition part 42. 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. | 258 Part III Document Objects Reference Example with Listing 16-21 on the CD-ROM On the CD-ROm Related Items window.disableExternalCapture window.enableExternalCapture window.handleEvent window.releaseEvents window.routeEvent methods. clearInterval intervalIDnumber Returns Nothing. NN2 NN3 NN4 NN6 IE3 J1 IE3 J2 IE4 IE5 IE5.5 Compatibility Use the window.clearInterval method to turn off an interval loop action started with the window.setInterval method. The parameter is the ID number returned by the setInterval method. A common application for the JavaScript interval mechanism is animation of an object on a page. If you have multiple intervals running each has its own ID value in memory. You can turn off any interval by its ID value. As soon as an interval loop stops your script cannot resume that interval It must start a new one which generates a new ID value. Example on the CD-ROM On the CD-ROM Related Items window.setInterval window.setTimeout window.clearTimeout methods. clearTimeout timeoutIDnumber Returns Nothing. NN2 NN3 NN4 NN6 IE3 J1 IE3 J2 IE4 IE5 IE5.5 Compatibility Use the window.clearTimeout method in concert with the window. setTimeout method as described later in this chapter when you want your script to cancel a timer that is waiting to run its expression. The parameter for this method is the ID number that the window.setTimeout method returns when the timer starts ticking. The clearTimeout method cancels the specified timeout. A good practice is to check your code for instances where user action may negate the need for a running timer and to stop that timer before it goes off. w ndowO6 ect.clearTimeout Chapter 16 Window and Frame Objects 259 On h Example with Figure 16-11 and Listing 16-22 on the CD-ROM Related Items window.setTimeout method. close Returns Nothing. NN2 NN3 NN4 NN6 IE3 J1 IE3 J2 IE4 IE5 IE5.5 Compatibility The window.close method closes the browser window referenced by the window object. Most likely you will use this method to close