tailieunhanh - JavaScript Bible, Gold Edition part 172

JavaScript Bible, Gold Edition part 172. 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-202 Part VI Appendixes Example Use The Evaluator to experiment with the normalize method in NN6. The following sequence adds a text node adjacent to one in the myP element. A subsequent invocation of the normalize method removes the division between the adjacent text nodes. Begin by confirming the number of child nodes of the myP element myP . Three nodes initially inhabit the element. Next create a text node and append it as the last child of the myP element a This means you myP .appendChild a With the new text now rendered on the page the number of child nodes increases to four myP . You can see that the last child node of myP is the text node you just created myP . But by invoking normalize on myP all adjacent text nodes are accumulated into single nodes myP .normalize You can now see that the myP element is back to three child nodes and the last child is a combination of the two previously distinct but adjacent text nodes myP . myP . releaseCapture setCapture containerBoolean NN2 NN3 NN4 NN6 IE3 J1 IE3 J2 IE4 IE5 Compatibility Appendix F Examples from Parts III and IV CD-203 Example Listing 15-30 demonstrates the usage of setCapture and releaseCapture in a quick-and-dirty context menu for IE5 Windows. The job of the context menu is to present a list of numbering styles for the ordered list of items on the page. Whenever the user brings up the context menu atop the OL element the custom context menu appears. Event capture is turned on in the process to prevent mouse actions elsewhere on the page from interrupting the context menu choice. Even a click on the link set up as the title of the list is inhibited while the context menu is visible. A click

TỪ KHÓA LIÊN QUAN