【发布时间】:2015-10-02 12:29:39
【问题描述】:
要访问我的主文档中的 iframe,我使用以下代码
// First iFrame in the main document
var iFrame = document.querySelector("iframe");
// Second iFrame in the iFrame
var iFrame_2 = iFrame.contentWindow.document.querySelector("iframe");
// Third iFrame ... here i get a "permission denied error"
var iFrame_3 = iFrame_2.contentWindow.document.querySelector("iframe");
当我尝试访问第三个 iFrame 时,我得到权限拒绝访问文档,为什么?
【问题讨论】:
标签: javascript iframe window document