Hello I have a rendered jsp that does what I want, I need to show it on the second display, how would I copy the entire dom of the current window and create a pletely new window? I will later want from the master to further edit that child window and write to it. Any insight greatly appreciated.
Hello I have a rendered jsp that does what I want, I need to show it on the second display, how would I copy the entire dom of the current window and create a pletely new window? I will later want from the master to further edit that child window and write to it. Any insight greatly appreciated.
Share Improve this question asked Feb 13, 2011 at 1:59 cp.cp. 1,2715 gold badges15 silver badges27 bronze badges 9-
@SLaks: agreed. Anyways, I would copy the
document.body.innerHTML
into the new page. – JCOC611 Commented Feb 13, 2011 at 2:02 -
1
That's a very expensive operation. Do you want the entire
DOM
or just the content of theBody Node
– Raynos Commented Feb 13, 2011 at 2:04 - @Raynos really? It used to be the case that (at least in IE) using "innerHTML" was much faster than discrete DOM operations. – Pointy Commented Feb 13, 2011 at 2:05
- possible duplicate of Copy Current Webpage Into a New Window – SpliFF Commented Feb 13, 2011 at 2:07
- 1 @Pointy With a lot of hacking and black magic is it actaully possible to clone the entire state of the page into a new window? – Raynos Commented Feb 13, 2011 at 2:12
1 Answer
Reset to default 2That would be tricky. You can certainly open a new window and municate with it but you can't pass DOM objects. You would basically need to convert the generated DOM to a string, pass it across to the new window and then parse it as though it was a document.
Like this: Copy Current Webpage Into a New Window