CD-200 Part VI . (Free php web host) Appendixes Example Use The
Sunday, September 30th, 2007CD-200 Part VI . Appendixes Example Use The Evaluator (Chapter 13) to experiment with the item() method. Type the following statements into the topmost text box and view the results for each: NN6 and IE5 document.getElementById( myP ).childNodes.length document.getElementById( myP ).childNodes.item(0).data document.getElementById( myP ).childNodes.item(1).nodeName NN6, IE4, and IE5 document.forms[1].elements.item(0).type IE4 and IE5 document.all.item( myP ).outerHTML myP.outerHTML In the last two examples, both statements return the same string. The first example is helpful when your script is working with a string version of an object s name. If your script already knows the object reference, then the second approach is more efficient and compact. mergeAttributes( sourceObject ) NN2 NN3 NN4 NN6 IE3/J1 IE3/J2 IE4 IE5 IE5.5 Compatibility Example Listing 15-29 demonstrates the usage of mergeAttributes()in the process of replicating the same form input field while assigning a unique ID to each new field. So you can see the results as you go, I display the HTML for each input field in the field. The doMerge() function begins by generating two new elements: a P and an INPUT element. Because these newly created elements have no properties associated with them, a unique ID is assigned to the INPUT element via the uniqueIDproperty. Attributes from the field in the source code (field1) are merged into the new INPUT element. Thus, all attributes except name and idare copied to the new element. The INPUT element is inserted into the P element, and the P element is appended to the document s form element. Finally, the outerHTML of the new element is displayed in its field. Notice that except for the NAME and ID attributes, all elementObject.mergeAttributes()
Note: In case you are looking for affordable and reliable webhost to host and run your j2ee application check Vision J2ee Web Hosting services.