--- title: 'Error: Permission denied to access property "x"' slug: Web/JavaScript/Reference/Errors/Property_access_denied tags: - Error - Errors - JavaScript - Security translation_of: Web/JavaScript/Reference/Errors/Property_access_denied ---
JavaScript の例外 "Permission denied to access property" は、権限がない状態でオブジェクトへのアクセスの試行があった場合に発生します。
Error: Permission denied to access property "x"
{{jsxref("Error")}}
権限がない状態でオブジェクトへのアクセスの試行がありました。これは異なるドメインから読み込んだ {{HTMLElement("iframe")}} 要素が同一オリジンポリシーに違反する場合などです。
<!DOCTYPE html>
<html>
<head>
<iframe id="myframe" src="http://www1.w3c-test.org/common/blank.html"></iframe>
<script>
onload = function() {
console.log(frames[0].document);
// Error: Permission denied to access property "document"
}
</script>
</head>
<body></body>
</html>