Reputation: 8487
How can we insert the content of 1 iframe into another. Is this possible?
Upvotes: 0
Views: 79
Reputation: 1206
if I understood your question correctly. Something like this. But you should optimize this part of code before use it.
var oIFrame1 = document.getElementById("myframe1"),
oIFrame2 = document.getElementById("myframe2");
var oDoc1 = (oIFrame1.contentWindow || oIFrame1.contentDocument);
if (oDoc1.document) oDoc1 = oDoc1.document;
var oDoc2 = (oIFrame2.contentWindow || oIFrame2.contentDocument);
if (oDoc2.document) oDoc2 = oDoc2.document;
oDoc1.body.innerHTML = oDoc2.body.innerHTML;
Upvotes: 1