开发者

How to add iframe content to main page?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜