2010-06-14 94 views

回答

0

您可以通過使用以下功能獲得iframe的內容,比您可以在主頁面html中添加內容。

function getContentFromIframe(iFrameName) 
{ 

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

    //Do whatever you need with the content  

} 

更多詳細覈查:http://www.roseindia.net/java/pass-value-example/pass-value-from-iframe-parent.shtml

+0

鏈接,但如何通過innerHTML來獲取IFRAME – rajesh 2010-06-14 11:39:35

+0

的值,你可以能夠訪問你想要 – 2010-06-14 11:58:29

+0

什麼呢atually幀的內容是我想要的是,如果我點擊iframe中的任何圖像,它將產生價值,通過捕獲該值,我將能夠做一些另一項任務。 這就是我想要的... 請儘快回覆 謝謝 – rajesh 2010-06-14 12:04:22

相關問題