blob: 1df56e4c5b0ff57290f4968055500b1910365c73 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
  | 
---
title: 'Error: Permission denied to access property "x"'
slug: Web/JavaScript/Reference/Errors/Property_access_denied
tags:
  - Error
  - JavaScript
  - Seguridad
  - errores
translation_of: Web/JavaScript/Reference/Errors/Property_access_denied
---
<div>{{jsSidebar("Errors")}}</div>
<h2 id="Mensaje">Mensaje</h2>
<pre class="syntaxbox">Error: Permission denied to access property "x"</pre>
<h2 id="Tipo_de_error">Tipo de error</h2>
<p>{{jsxref("Error")}}.</p>
<h2 id="¿Cuál_es_el_problema">¿Cuál es el problema?</h2>
<p><span class="seoSummary">Se ha intentado acceder a un objeto al cual no tienes permiso. Probablemente es un elemento {{HTMLElement("iframe")}} cargado de otro dominio en el cual violaste la <a href="/en-US/docs/Web/Security/Same-origin_policy">política del mismo origen</a>.</span></p>
<h2 id="Ejemplos">Ejemplos</h2>
<pre class="brush: html"><!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></pre>
<h2 id="Véase_también">Véase también</h2>
<ul>
 <li>{{HTMLElement("iframe")}}</li>
 <li><span class="seoSummary"><a href="/en-US/docs/Web/Security/Same-origin_policy">Política del mismo origen</a></span></li>
</ul>
 
  |