MDN may have intermittent access issues April 18 13:00 - April 19 01:00 UTC. See whistlepig.mozilla.org for all notifications.

mozilla

Revision 37157 of WRONG DOCUMENT ERR note

  • Revision slug: DOM/WRONG_DOCUMENT_ERR_note
  • Revision title: WRONG DOCUMENT ERR note
  • Revision id: 37157
  • Created:
  • Creator: Sheppy
  • Is current revision? No
  • Comment revised since we don't throw WRONG_DOCUMENT_ERR anymore after all
Tags: 

Revision Content

Nodes from external documents should be cloned using importNode() (or adopted using adoptNode()) before they can be inserted into the current document. For more on the ownerDocument issues see the W3C DOM FAQ.

Firefox does not presently enforce this rule (it did for a while during the development of Firefox 3, but too many sites break when this rule is enforced). We encourage web developers to fix their code to follow this rule for improved future compatibility.

{{ languages( { "fr": "fr/DOM/WRONG_DOCUMENT_ERR_note", "ja": "ja/DOM/WRONG_DOCUMENT_ERR_note", "pl": "pl/DOM/WRONG_DOCUMENT_ERR_note" } ) }}

Revision Source

<p>Nodes from external documents should be cloned using <code><a href="en/DOM/document.importNode">importNode()</a></code> (or adopted using <code><a href="en/DOM/document.adoptNode">adoptNode()</a></code>) before they can be inserted into the current document. For more on the <code><a href="en/DOM/element.ownerDocument">ownerDocument</a></code> issues see the <a class="external" href="http://www.w3.org/DOM/faq.html#ownerdoc">W3C DOM FAQ</a>.
</p><p>Firefox does not presently enforce this rule (it did for a while during the development of Firefox 3, but too many sites break when this rule is enforced). We encourage web developers to fix their code to follow this rule for improved future compatibility.
</p>
<div class="noinclude">
</div>
{{ languages( { "fr": "fr/DOM/WRONG_DOCUMENT_ERR_note", "ja": "ja/DOM/WRONG_DOCUMENT_ERR_note", "pl": "pl/DOM/WRONG_DOCUMENT_ERR_note" } ) }}
Revert to this revision