Availability
DOM Level 2 Core
Synopsis
Node importNode(Node importedNode,
boolean deep)
throws DOMException;
Arguments
importedNode
The node to be imported. deep
If true, recursively copy all descendants of
importedNode as well.
Returns
A copy of importedNode (and possibly all
of its descendants) with its ownerDocument set to
this document.
Throws
This method throws a DOMException with a code of
NOT_SUPPORTED_ERR if
importedNode is a Document or DocumentType
node, since those types of nodes cannot be imported.
Description
This method is passed a node defined in another document and returns
a copy of the node that is suitable for insertion into this document.
If deep is true, all
descendants of the node are also copied. The original node and its
descendants are not modified in any way. The returned copy has its
ownerDocument property set to this document but
has a parentNode of null since
it has not yet been inserted into the document. EventListener
functions registered on the original node or tree are not copied.
When an Element node is imported, only the attributes that are
explicitly specified in the source document are imported with it.
When an Attr node is imported, its specified
property is automatically set to true.
See Also
Node.cloneNode( )
•
Table of Contents
•
Index
•
Reviews
•
Examples
•
Reader Reviews
•
Errata
JavaScript: The Definitive Guide, 4th Edition
By
David Flanagan
Publisher
: O'Reilly
Pub Date
: November 2001
ISBN
: 0-596-00048-0
Pages
: 936
Slots
: 1
This fourth edition of the definitive reference to
JavaScript, a scripting language that can be embedded
directly in web pages, covers the latest version of the
language, JavaScript 1.5, as supported by Netscape 6 and
Internet Explorer 6. The book also provides complete
coverage of the W3C DOM standard (Level 1 and Level 2),
while retaining material on the legacy Level 0 DOM for
backward compatibility.