A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Errors/Property_access_denied below:

Error: Permission denied to access property "x" - JavaScript

Error: Permission denied to access property "x" 消息
Error: Permission denied to access property "x"
错误类型

错误.

什么地方出错了?

尝试访问无权访问的对象。这很可能出现在使用<iframe>元素时加载了一个不同域名下的页面,这在访问子页面时会违背同源策略。

示例
<!doctype html>
<html>
  <head>
    <iframe
      id="myframe"
      src="http://www1.w3c-test.org/common/blank.html"></iframe>
    <script>
      console.log(document.getElementById("myframe").contentWindow.document);
      // Error: Permission denied to access property "document"
    </script>
  </head>
  <body></body>
</html>

可以参考


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4