Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>When thinking about creating a copy of the DOM, the following methods can be useful:</p> <ul> <li><a href="https://developer.mozilla.org/en/DOM/document.createDocumentFragment" rel="nofollow noreferrer"><code>document.createDocumentFragment()</code></a> - Creates a plain "node storage" object.</li> <li><a href="https://developer.mozilla.org/En/DOM/DOMImplementation.createDocument" rel="nofollow noreferrer"><code>document.implementation.createDocument</code></a> and the <a href="https://stackoverflow.com/a/9251106/938089?javascript-domparser-access-innerhtml-and-other-properties">DOMParser</a> - Create and manipulate full document.</li> <li><a href="https://developer.mozilla.org/En/DOM/Node.cloneNode" rel="nofollow noreferrer"><code>cloneNode</code></a> - Copy a node (DOM manipulation using <a href="https://developer.mozilla.org/en/DOM/element.appendChild" rel="nofollow noreferrer"><code>appendChild</code></a> and <a href="https://developer.mozilla.org/En/DOM/Node.replaceChild" rel="nofollow noreferrer"><code>replaceChild</code></a>).</li> </ul> <p>These methods are very useful for DOM structures, but unfortunately, they do not return useful values for dimensions.</p> <p>The elements have to be rendered. This can be done by creating an <code>&lt;iframe&gt;</code> element, and insert the document (nodes) in it. The previously mentioned methods can be used for this purpose: Create an effective copy of (part of) the document, and insert the document into the iframe.</p> <p>It might be useful to also insert a <a href="https://developer.mozilla.org/en/DOM/HTMLBaseElement" rel="nofollow noreferrer"><code>&lt;base&gt;</code></a> element in the <code>&lt;head&gt;</code>, so that URLs and images are correctly resolved.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload