tailieunhanh - JavaScript Bible, Gold Edition part 137

JavaScript Bible, Gold Edition part 137. 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. | 1208 Part V Putting JavaScript to Work Listing 44-9 continued TD TR TABLE FORM OBJECT ID jukebox WIDTH 1 HEIGHT 1 CLASSID CLSID 22d6f312-b0f6-11d0-94ab-0080c74c7e95 CODEBASE Version 6 0 0 0 PARAM NAME AutoStart VALUE false EMBED NAME jukebox HEIGHT 2 WIDTH 2 SRC HIDDEN TRUE AUTOSTART FALSE AUTOPLAY FALSE ENABLEJAVASCRIPT TRUE MASTERSOUND EMBED OBJECT BODY HTML You can see the user interface in Figure 44-5. One SELECT element contains a list of three possible choices. Most of the interface however consists of buttons that ultimately invoke methods of the current plug-in. Figure 44-5 The jukebox page Chapter 44 Scripting Java Applets and Plug-ins 1209 Two functions are invoked by the onLoad event handler besides the initialization routine of the library. The loadFirst function finds out which of the items in the SELECT element is chosen when the page loads and it makes sure that the file is pre-loaded into the plug-in. This functionality is provided in case the user makes a choice and should use the Back button or history to return to the page. In some browsers the SELECT element will be set to its most recent setting so the loadFirst function simply gets everything ready. The second onLoad function call is to displayVol . This function works its way through the library to read the volume setting of the plug-in and displays the resulting value in a text box in the form. Not all plug-ins use the same scale or numbering system for their volume controls. Windows Media Player 6 for instance uses very large negative numbers while QuickTime and LiveAudio are on different positive scales. The other volume-related functions simply increase or decrease the current setting by 10 percent in response to clicking the associated buttons in the interface. All functions defined for this page are designed to be as generalizable as possible. Thus the identifier of the plug-in is passed as a parameter to each. If another plug-in were added to this page the same functions

TỪ KHÓA LIÊN QUAN