aboutsummaryrefslogtreecommitdiff
path: root/files/ja/web/api/window/parent/index.html
blob: 6e8f1e986d4919cef33128b581a960fa8edc9749 (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
---
title: window.parent
slug: Web/API/Window/parent
tags:
  - API
  - Gecko
  - HTML DOM
  - Window
translation_of: Web/API/Window/parent
---
<p>{{ APIRef() }}</p>

<h2 id="Summary" name="Summary">概要</h2>

<p>現在のウィンドウ、または、サブフレームの親ウィンドウへの参照を返します。</p>

<p>ウィンドウが親を持たない場合、<code>parent</code> プロパティは、それ自身への参照となります。</p>

<p>ウィンドウが {{htmlelement("iframe")}}{{htmlelement("object")}} 、あるいは、{{htmlelement("frame")}} で読み込まれた場合、その親ウィンドウは、ウィンドウを埋め込んだ要素が存在するウィンドウとなります。</p>

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

<pre class="syntaxbox"><var>parentWindow</var> = window.parent
</pre>

<h2 id="Example" name="Example"></h2>

<pre class="brush:js">if (window.parent !== window.top) {
  // 1 段下より深いところ
}
</pre>

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

<ul>
 <li><a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/browsers.html#dom-parent">HTML Standard</a></li>
</ul>

<h2 id="See_also" name="See_also">関連情報</h2>

<ul>
 <li>{{domxref("window.frameElement")}} - <code>window</code> が埋め込まれた(<code>&lt;iframe&gt;</code> 要素などの)特定の要素を返す</li>
 <li>{{domxref("window.top")}} - 最上位ウィンドウへの参照を返す</li>
</ul>