Aplicativos do Windows
Recolher sumário
Expandir sumário
EN
Este conteúdo não está disponível em seu idioma, mas aqui está a versão em inglês.

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.4

 

Syntax

var ppNodeDest = document.adoptNode(pNodeSource);

Parameters

pNodeSource [in]

Type: IHTMLDOMNode

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

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

 

 

Mostrar:
© 2017 Microsoft