javascript document importNode( )
importNode( ) | Firefox/Netscape/NN 6 IE n/a Chrome/Safari/DOM 2 |
importNode(nodeReference, deepBoolean) |
|
Imports a node object from another loaded document into the current document, but not yet into the document tree. In many ways, importNode( ) works like cloneNode( ), but it assumes that the source node may exist in an entirely different document tree context (especially in an XML document). W3C DOM rules for this method govern what properties and attributes of the source node make the journey and what happens to them upon their arrival. For example, an Attr node loses its ownerElement (i.e., its value becomes null) when imported from an element in one document into a fragment-like state in the new documentuntil the attribute gets added to an element in the new document. Nodes of Document and DocumentType types are not importable. |
|
The importNode( ) method does not assume the responsibility of persistence between documents. That's where, for instance, a JavaScript variable comes into play. As with cloneNode( ), the importNode( ) method does not disturb the source node. |
|
Parameters | |
|
|
Returned Value | |
Reference to the imported copy of the node object. |
containernode.replaceChild(document.importNode(node_from_other_doc,true),previousnode);
Powered by Linode.