我在那裏使用以下腳本,在我的頁面上形成此腳本添加iframe,並且我想要獲取iframe html。權限被拒絕訪問屬性「文檔」
<script src="http://ads.sonobi.com/ttj?id=881134" type="text/javascript"></script>
問題是在iframe中有內部iframe。
使用的ifrmae
document.getElementById('f1').contentWindow.document.body.innerHTML
獲取內容當我運行這將顯示以下錯誤
Permission denied to access property 'document'
如何解決權限否認問題的Javascript下面的函數。
您無法訪問DOM的IFRAME是從不同於執行腳本不同的域。這被稱爲跨站點腳本 –
重複:http://stackoverflow.com/q/7995223/819417 –