aboutsummaryrefslogtreecommitdiff
path: root/files/ja/web/api/window/alert
diff options
context:
space:
mode:
Diffstat (limited to 'files/ja/web/api/window/alert')
-rw-r--r--files/ja/web/api/window/alert/index.html70
1 files changed, 70 insertions, 0 deletions
diff --git a/files/ja/web/api/window/alert/index.html b/files/ja/web/api/window/alert/index.html
new file mode 100644
index 0000000000..d9b54c9c44
--- /dev/null
+++ b/files/ja/web/api/window/alert/index.html
@@ -0,0 +1,70 @@
+---
+title: window.alert
+slug: Web/API/Window/alert
+tags:
+ - API
+ - DOM
+ - Gecko
+ - Method
+ - Reference
+ - Window
+ - alert
+translation_of: Web/API/Window/alert
+---
+<div>{{ApiRef}}</div>
+
+<p><strong><code>Window.alert()</code></strong> メソッドは、オプションの指定されたコンテンツと OK ボタンを持つ警告ダイアログを表示します。</p>
+
+<h2 id="Syntax" name="Syntax">構文</h2>
+
+<pre class="syntaxbox"><code>window.alert(<em>message</em>);</code></pre>
+
+<ul>
+ <li><strong><code>message</code></strong> は、警告ダイアログに表示したいオプションの文字列または、文字列に変換されて表示されるオブジェクトです。</li>
+</ul>
+
+<h2 id="Example" name="Example">例</h2>
+
+<pre class="brush: js">window.alert("Hello world!");
+</pre>
+
+<p>以下のように表示されます。</p>
+
+<p><img alt="Image:AlertHelloWorld.png" src="/files/130/AlertHelloWorld.png"></p>
+
+<h2 id="Notes" name="Notes">注記</h2>
+
+<p>警告ダイアログは、メッセージの確認応答以外の、ユーザ側で応答を必要としないメッセージのために使われるべきです。</p>
+
+<p>ダイアログボックスはモーダルウィンドウです。つまりユーザーは、これを閉じないとプログラムの他のインターフェイス部分にアクセスする事ができません。ですから、ダイアログボックス (もしくは、モーダルウィンドウ) を生成する関数を過度に使用すべきではありません。</p>
+
+<p>Mozilla Chrome ユーザー (Firefox 拡張など) は、<a href="/ja/docs/NsIPromptService">nsIPromptService</a> メソッドを代わりに使うべきです。</p>
+
+<p>{{CompatChrome(46.0)}} 以降、このメソッドは、sandbox 属性の値が <code>allow-modal</code> でない限り、{{htmlelement("iframe")}} 内でブロックされます。</p>
+
+<p>{{gecko_minversion_inline("23.0")}} この引数は、仕様により必要に応じてオプションになりました。</p>
+
+<h2 id="Specification" name="Specification">仕様</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', 'timers-and-user-prompts.html#dom-alert', 'alert()')}}</td>
+ <td>{{Spec2('HTML WHATWG')}}</td>
+ <td> </td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="See_also" name="See_also">関連情報</h2>
+
+<ul>
+ <li>{{domxref("window.confirm","confirm")}}</li>
+ <li>{{domxref("window.prompt","prompt")}}</li>
+ <li><a href="/ja/docs/Chrome">Mozilla Chrome</a> については、{{ifmethod("nsIPromptService","alert")}} と {{ifmethod("nsIPromptService","alertCheck")}} を参照してください。</li>
+</ul>