Tip, Moving DOM nodes

How to avoid Wrong document exceptions

From the developerWorks archives

Brett McLaughlin

Date archived: May 14, 2019 | First published: March 01, 2001

This tip takes a look at a common exception that occurs when you attempt to move DOM nodes. Here you'll learn the causes of this exception and, most important, how to avoid it when doing DOM programming. The code listings demonstrate how to move nodes from one document to another, what the code that generates the dreaded Wrong document exception looks like, and how to write correct code that doesn't present this problem. This tip assumes that you already know the basics about how to work with the DOM."

This content is no longer being updated or maintained. The full article is provided "as is" in a PDF file. Given the rapid evolution of technology, some content, steps, or illustrations may have changed.

ArticleTitle=Tip: Moving DOM nodes