Is there a way to move the entire dom (javascript state, document state, everything) from one document to another?
My first thought was to use an iframe
but apparently you can't move the iframe around the dom without it reloading.
My second thought was to do a deep copy of the window object, but obviously that is time consuming, has many pitfalls, and doesn't handle the dom state.
Is it possible to do this? I basically want to sandbox one document and then move/copy it's state to another document.
FYI it's a node-webkit app. I want to copy the dom from one window into another window.
For example can I do:
window2.document = window1.document;
window2.document.body.innerHtml( window1.document.body ); //dont know the syntax