aboutsummaryrefslogtreecommitdiff
path: root/files/ja/web/api/window/frameelement/index.html
blob: ab266fa993bbfef733407e3737b59c943b2602c5 (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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
---
title: window.frameElement
slug: Web/API/Window/frameElement
tags:
  - API
  - DOM
  - Gecko
  - HTML DOM
  - Window
translation_of: Web/API/Window/frameElement
---
<div>{{ ApiRef }}</div>

<p>{{HTMLElement("iframe")}}{{HTMLElement("object")}} のような)ウィンドウが埋め込まれた要素を返します。要素がトップレベルであるか異なるスクリプト生成元をもつ文書に埋め込まれるかのいずれかの場合は、 <code>null</code> を返します。</p>

<h2 id="構文">構文</h2>

<pre class="syntaxbox"><var>frameEl</var> = window.frameElement;
</pre>

<ul>
 <li><code>frameEl</code> は、ウィンドウが埋め込まれた要素です。ウィンドウが別の文書に埋め込まれていない場合、または埋め込まれている文書が異なる生成元を持つ(例えば異なるドメインから設置されている)場合、これは <code>null</code> になります。</li>
</ul>

<div class="note">
<p>このプロパティの名前にもかかわらず、これは{{HTMLElement("object")}}{{HTMLElement("iframe")}}、または <a href="https://developer.mozilla.org/ja/docs/Web/HTML/Element/embed">&lt;embed&gt;</a>を含むすべての埋め込みポイント内に埋め込まれた文書の役に立ちます。</p>
</div>

<h2 id="例"></h2>

<pre class="brush:js">var frameEl = window.frameElement;
// 埋め込みの場合、要素の URL が 'http://mozilla.org/' に変わります。
if (frameEl) {
  frameEl.src = 'http://mozilla.org/';
}
</pre>

<h2 id="仕様">仕様</h2>

<table class="standard-table">
 <thead>
  <tr>
   <th scope="col">仕様</th>
   <th scope="col">状態</th>
   <th scope="col">コメント</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td>{{ SpecName('HTML WHATWG', '#dom-frameelement', 'Window.frameElement') }}</td>
   <td>{{ Spec2('WebRTC 1.0') }}</td>
   <td>初期の仕様</td>
  </tr>
 </tbody>
</table>

<h2 id="ブラウザー互換性">ブラウザー互換性</h2>

<div>{{CompatibilityTable}}</div>

<div id="compat-desktop">
<table class="compat-table">
 <tbody>
  <tr>
   <th>機能</th>
   <th>Chrome</th>
   <th>Firefox (Gecko)</th>
   <th>Internet Explorer</th>
   <th>Opera</th>
   <th>Safari</th>
  </tr>
  <tr>
   <td>基本サポート</td>
   <td>4?</td>
   <td>{{CompatGeckoDesktop("1")}}</td>
   <td>5.5?</td>
   <td>12.1?</td>
   <td>4?</td>
  </tr>
 </tbody>
</table>
</div>

<div id="compat-mobile">
<table class="compat-table">
 <tbody>
  <tr>
   <th>機能</th>
   <th>Android</th>
   <th>Firefox Mobile (Gecko)</th>
   <th>IE Mobile</th>
   <th>Opera Mobile</th>
   <th>Safari Mobile</th>
  </tr>
  <tr>
   <td>基本サポート</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatGeckoDesktop("1")}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
  </tr>
 </tbody>
</table>
</div>

<h2 id="関連項目">関連項目</h2>

<ul>
 <li>{{domxref("window.frames")}} は、現在のウィンドウの直接のサブフレームを一覧する、配列のようなオブジェクトを返します。</li>
 <li>{{domxref("window.parent")}} は、子ウィンドウの<code>frameElement</code>を含むウィンドウである、親ウィンドウを返します。</li>
</ul>