242 CHAPTER 8 (Java web server) SCRIPTING IN THE BROWSER
242 CHAPTER 8 SCRIPTING IN THE BROWSER Table 8-3. Continued Function Name Description Public _Moz_node_transformNode An implementation of the transformNode() No (oStylesheetDOM) method for the Mozilla DOM. You add a method to the Mozilla DOM to call this function. _Moz_node_transformNodeToObject An implementation of the No (oStylesheetDOM,oOutputDOM) transformNodeToObject() method for the Mozilla DOM. You add a method to the Mozilla DOM to call this function. _Moz_Node_getXML() An implementation of the xml property No for the Mozilla DOM. You add a property to the Mozilla DOM to call this function. updateReadyState(oDOMDocument, Changes the readyState property No intReadyState) to the DOM and calls the added onreadystatechange() event handler if there is one. Note The xDOM library uses the Ultimate JavaScript Client Sniffer Version 3.03 created by Netscape Communications. This is included in the code directory (as browserDetect.js), along with xDOM.js.You need to include both of these JavaScript files to use xDOM. xDOM Walkthrough This section walks through the xDOM.js file and describes the code therein. If you aren t interested in the details of the xDOM wrapper, please feel free to skip ahead to the Using JavaScript with the DOM section. The code starts by declaring global variables that library functions will use. The most important line follows: var arrMSXMLProgIDs = [”MSXML4.DOMDocument”, “MSXML3.DOMDocument”, . “MSXML2.DOMDocument”, “MSXML.DOMDocument”, “Microsoft.XmlDom”]; This line creates an array of strings that contain the ProgIDs for creating different versions of the MSXML DOMDocument object. The next step initializes the wrapper. The method used depends on the browser version. Initializing in IE For IE, the initialization code determines which version of MSXML a user has available on his or her machine by iterating through the arrMSXMLProgIDs array:
Searching for affordable and proven webhost to host and run your servlet applications? Go to Linux Web Hosting services and you will find it.