aboutsummaryrefslogtreecommitdiff
path: root/files/ja/web/api/window/name/index.html
blob: 0dbd1ab6c90d0f9ed19a19dcac8d6e5e7b632f6b (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
---
title: window.name
slug: Web/API/Window/name
tags:
  - API
  - HTML DOM
  - Property
  - Reference
  - Window
translation_of: Web/API/Window/name
---
<div>{{ApiRef}}</div>

<p class="summary"><span class="seoSummary">ウィンドウ名を取得 / 設定します。</span></p>

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

<pre class="syntaxbox"><var>string</var> = window.name;
window.name = <var>string</var>;
</pre>

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

<pre class="brush:js">window.name = "lab_view";
</pre>

<h2 id="Notes" name="Notes">注記</h2>

<p>ウィンドウ名は、主にハイパーリンクとフォームのターゲットを設定するために使われます。ウィンドウは必ずしもウィンドウ名を持つ必要はありません。</p>

<p>It has also been used in some frameworks for providing cross-domain messaging (e.g., <a href="http://www.thomasfrank.se/sessionvars.html">SessionVars</a> and Dojo's <a href="http://www.sitepen.com/blog/2008/07/22/windowname-transport/">dojox.io.windowName</a>) as a more secure alternative to JSONP. Modern web applications hosting sensitive data should however not rely on <code>window.name</code> for cross-domain messaging but instead rather utilize the <a href="/ja/docs/Web/API/Window/postMessage">postMessage API</a>.</p>


<p>Don't set the value to something unstring since its get method will call the toString method.</p>

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

<table class="standard-table">
 <tbody>
  <tr>
   <th scope="col">仕様</th>
   <th scope="col">状態</th>
   <th scope="col">コメント</th>
  </tr>
  <tr>
   <td>{{SpecName('HTML WHATWG', 'browsers.html#dom-name', 'Window.name')}}</td>
   <td>{{Spec2('HTML WHATWG')}}</td>
   <td> </td>
  </tr>
  <tr>
   <td>{{SpecName('HTML5 W3C', 'browsers.html#dom-name', 'Window.name')}}</td>
   <td>{{Spec2('HTML5 W3C')}}</td>
   <td> </td>
  </tr>
 </tbody>
</table>