How to prevent an iframe from reloading when moving it in the DOM

If you’re trying to move it visually, you can try modifying the CSS to use absolute positioning or some other adjustments.

However, if you’re trying to actually pull it out of the DOM and insert it somewhere else, you won’t be able to avoid a reload.

I don’t think so, as the browser is going to re-render/reload the iframe when it’s put back in the DOM.

http://polisick.com/moveNode.php better explains it.

To move a node you call removeNode to take it out of the tree and into memory, then appendNode to ‘paste’ it back where you want it.

Leave a Comment