CD-125Appendix F . Examples from Parts III and IV case 1: output += < + group[i].tagName output += (group[i].id) ? ID= + group[i].id : output += (group[i].name) ? NAME= + group[i].name : output += >n break case 3: txt = group[i].nodeValue.substr(0,15) output += [Text: + txt.replace(/[rn]/g, ) if (group[i].nodeValue.length > 15) { output += … } output += ]n break case 8: output += [!COMMENT!]n break default: output += [Node Type = + group[i].nodeType + ]n } if (group[i].childNodes.length > 0) { output += walkChildNodes(group[i], n+1) } } return output } children NN2 NN3 NN4 NN6 IE3/J1 IE3/J2 IE4 IE5 IE5.5 Compatibility Example The walkChildren() function shown in Listing 15-4 accumulates and returns a hierarchical list of child elements from the point of view of the document s HTML element (the default) or any element whose ID you pass as a string parameter. This function is embedded in The Evaluator so that you can inspect the parent child hierarchy of that page or (when using evaluator.jsfor debugging as described in Chapter 45) the element hierarchy within any page you have under construction. Try it out in The Evaluator in IE5+ by entering the following statements into the top text field: elementObject.children
Searching for affordable and reliable webhost to host and run your web applications? Go to our java web server services and you will be pleased.