EN
Ce contenu n’est pas disponible dans votre langue. Voici la version anglaise.

adoptNode method

Tries to move a node from one document to the document that the document object displays.

Document Object Model (DOM) Level 3 Core Specification, Section 1.4Internet Explorer 9

 

Syntax

var ppNodeDest = document.adoptNode(pNodeSource);

Parameters

pNodeSource [in]

Type: IHTMLDOMNode

A reference to the element object that refers to the node to move.

ppNodeDest [out, retval]

Type: IHTMLDOMNode3

A reference to the element object that refers to the node that has been moved, or a null value if the node cannot be moved.

Return value

Type: IHTMLDOMNode3

A reference to the element object that refers to the node that has been moved, or a null value if the node cannot be moved.

Standards information

Examples

The following code example illustrates the adoptNode method and shows one way to handle cases where the method fails.


var oNode = document.adoptNode( oXHTMLNode );
if ( oNode == null )
   oNode = document.importNode( oXHTMLNode );
parent.appendChild( oNode );

See also

document

 

 

Afficher:
© 2014 Microsoft