开发者

How to add iframe content to main page?

开发者 https://www.devze.com 2023-01-03 04:00 出处:网络
Actually i have iframe which has some important content in it ,but problem is that how ca开发者_开发问答n i have add content to my page in which that iframe resides.

Actually i have iframe which has some important content in it ,but problem is that how ca开发者_开发问答n i have add content to my page in which that iframe resides. Thanks


You can get content of iframe by using following function, than you can add content in main page html.

function getContentFromIframe(iFrameName)
{

    var myIFrame = document.getElementById(iFrameName);
    var content = myIFrame.contentWindow.document.body.innerHTML;

    //Do whatever you need with the content    

}

check for more detail : http://www.roseindia.net/java/pass-value-example/pass-value-from-iframe-parent.shtml

0

精彩评论

暂无评论...
验证码 换一张
取 消