Documentelement.innerhtml Not Showing The Iframe Body
i have got a page that has one iframe in it. i am making the iframe via javascript. later i need to save that page and reopen it with the exact contents. like e.g if the user wrote
Solution 1:
Based on this post, here a solution:
UPDATE
functionshowIF()
{
var f= document.getElementById('myIframe');
var d= f.contentDocument? f.contentDocument : f.contentWindow.document;
var customArea = document.getElementById('custom-area');
//read the content of iframevar iframeContent = d.body.innerHTML;
//delete the iframe himself
f.parentNode.removeChild(f);
//Append the html to parent div
customArea.innerHTML += iframeContent;
//console.log(d.body.innerHTML);
}
At least it works with my Chrome browser (Version 11.0.696.60)
Post a Comment for "Documentelement.innerhtml Not Showing The Iframe Body"