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 completely new window? I will later want from the master to further edit that child window and write to it. Any insight greatly appreciated.
Use the node. cloneNode() method to clone the node. Pass true into the cloneNode() method to create a deep clone of a DOM element.
Select the target element where div element is copied. Use the append() method to copy the element as its child.
The cloneNode() method creates a copy of a node, and returns the clone. The cloneNode() method clones all attributes and their values. Set the deep parameter to true if you also want to clone descendants (children).
If you want to also copy elements nested inside it, pass in true as an argument. // Get the element var elem = document. querySelector('#elem1'); // Create a copy of it var clone = elem. cloneNode(true);
That would be tricky. You can certainly open a new window and communicate 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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With