aboutsummaryrefslogtreecommitdiff
path: root/files/pt-br/web/javascript/reference/errors/property_access_denied/index.html
blob: 01bcf0009b3c8b8e3239676412f106207a4f1d1a (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
---
title: 'Error: Permission denied to access property "x"'
slug: Web/JavaScript/Reference/Errors/Property_access_denied
translation_of: Web/JavaScript/Reference/Errors/Property_access_denied
---
<div>{{jsSidebar("Errors")}}</div>

<h2 id="Mensagem">Mensagem</h2>

<pre class="syntaxbox">Error: Permission denied to access property "x"
</pre>

<h2 id="Tipo_de_erro">Tipo de erro</h2>

<p>{{jsxref("Error")}}.</p>

<h2 id="O_que_houve_de_errado">O que houve de errado?</h2>

<p><span class="seoSummary">Tentativa de acessar um objeto no qual você não possui permissões. Provavelmente um {{HTMLElement("iframe")}} carregado de um dominio diferente no qual foi violado o <a href="/en-US/docs/Web/Security/Same-origin_policy">same-origin policy</a>.</span></p>

<h2 id="Exemplos">Exemplos</h2>

<pre class="brush: html">&lt;!DOCTYPE html&gt;
&lt;html&gt;
  &lt;head&gt;
    &lt;iframe id="myframe" src="http://www1.w3c-test.org/common/blank.html"&gt;&lt;/iframe&gt;
    &lt;script&gt;
      onload = function() {
        console.log(frames[0].document);
        // Error: Permission denied to access property "document"
      }
    &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;&lt;/body&gt;
&lt;/html&gt;</pre>

<h2 id="Veja_também">Veja também</h2>

<ul>
 <li>{{HTMLElement("iframe")}}</li>
 <li><a href="/en-US/docs/Web/Security/Same-origin_policy">Same-origin policy</a></li>
</ul>