1.
Node.element_node (1); Element node Node.attribute_node (2); Attribute node Node.text_node (3); Text node
Each node has a ChildNodes property, which holds a NodeList object, accesses nodes in the nodelist, can be in square brackets, or it can use the item () method.
var firstchild = somenode.childnodes[0]; var secondchild = SomeNode.childNodes.item (1);
2. You can use the PreviousSibling and NextSibling properties to access the sibling elements. which
Somenode.firstnode = somenode.childnodes[0= somenode.childnodes[somenode.childnodes.length-1];
3. Node properties: Ownerdocument, which points to the document node that represents the entire document.
4. Operation node: Add a node to the end of the list, appendchild (Newcode).
5, InsertBefore (), receives two parameters: the node to be inserted and the node to be referenced.
Somenode.insertnode (NewNode, OldNode);
ReplaceChild (), receives two parameters: the node to be inserted and the node to be replaced.
Somenode.replacechild (NewNode, OldNode);
6, RemoveChild (), the method receives a parameter, that is, the node to be removed.
Somenode.removechild (Somenode.firstchild);
7, CloneNode (), used to create an identical copy of the node that called the method, to accept a Boolean parameter indicating whether to perform a deep copy, in case the parameter is true, to perform a deep copy, that is, the copy node and the entire child node tree, in case the parameter is false, perform a shallow copy , which is to replicate only the node itself.
8, normalize (), the only function is to process the text node in the document tree. If an empty text node is found, it is deleted and merged into a text node if an adjacent text node is found.
9, cross-domain security restrictions: from different subdomains of the page can not be through the JS communication, each page of the document.domain set to the same value, these pages will be able to access each other's JS object contained.
"JS Advanced Program Design" of Eight