Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/440.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 错误:访问iFrame中属性“document”的权限被拒绝,无法工作_Javascript_Iframe_Cross Domain - Fatal编程技术网

Javascript 错误:访问iFrame中属性“document”的权限被拒绝,无法工作

Javascript 错误:访问iFrame中属性“document”的权限被拒绝,无法工作,javascript,iframe,cross-domain,Javascript,Iframe,Cross Domain,我有两个页面home.html和window.html <html> <head> </head> <body> <script> window.opener.document.getElementById("comment").innerHTML = "Load from new window"; </script> </body> </html> home.html <

我有两个页面home.html和window.html

<html>
<head>
</head>
<body>
<script>    
window.opener.document.getElementById("comment").innerHTML = "Load from new window";    
</script>  
</body>
</html>
home.html

<html>
<head>
</head>
<body>
  <a href="window.html" onclick="return !window.open(this.href,'','height=400,width=600,resizable=1');">Populate from new Window</a>
 <div id="comment" >Div in parent</div>
</body>
</html>
window.html

<html>
<head>
</head>
<body>
<script>    
window.opener.document.getElementById("comment").innerHTML = "Load from new window";    
</script>  
</body>
</html>
问题是,当我单击“从新窗口填充”时,将打开一个正在发生的新子窗口,并使用“从新窗口加载”填充父元素中的div,而这并没有发生。它将Firefox中的错误设置为错误:访问属性“document”的权限被拒绝


有人能帮忙解决这个问题吗。我也没有签入其他浏览器,问题仍然存在。

是否使用文件测试此问题://@Derek Yes。我的一个网站有问题。为了验证这一点,我在桌面上创建了两个页面,并重新创建了该问题。在Chrome中,您不能使用文件协议,因为该页面是沙盒。我相信Firefox也是如此。试着在本地服务器上执行它。嗨,德里克,它对我有用。现在让我尝试修复我正在处理的站点中的问题。谢谢你的帮助