diff options
Diffstat (limited to 'files/ja/web/api/xmlhttprequest/error_event/index.html')
| -rw-r--r-- | files/ja/web/api/xmlhttprequest/error_event/index.html | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/files/ja/web/api/xmlhttprequest/error_event/index.html b/files/ja/web/api/xmlhttprequest/error_event/index.html new file mode 100644 index 0000000000..a42c9536e3 --- /dev/null +++ b/files/ja/web/api/xmlhttprequest/error_event/index.html @@ -0,0 +1,62 @@ +--- +title: XMLHttpRequestEventTarget.onerror +slug: Web/API/XMLHttpRequest/error_event +tags: + - API + - Property + - Reference + - Web + - XMLHttpRequestEventTarget + - イベントハンドラ +translation_of: Web/API/XMLHttpRequestEventTarget/onerror +original_slug: Web/API/XMLHttpRequestEventTarget/onerror +--- +<div>{{APIRef("XMLHttpRequest")}}</div> + +<p><strong><code>XMLHttpRequestEventTarget.onerror</code></strong> は、エラーの為に {{domxref("XMLHttpRequest")}} トランザクションが失敗した場合に呼び出される関数です。</p> + +<h2 id="Syntax" name="Syntax">構文</h2> + +<pre class="syntaxbox notranslate"><em>XMLHttpRequest</em>.onerror = <em>callback</em>;</pre> + +<h3 id="値">値</h3> + +<ul> + <li><code><em>callback</em></code> は、リクエストが失敗した場合に実行される関数です。</li> +</ul> + +<h2 id="Example" name="Example">例</h2> + +<pre class="brush: js notranslate">var xmlhttp = new XMLHttpRequest(), + method = 'GET', + url = 'https://developer.mozilla.org/'; + +xmlhttp.open(<em>method</em>, <em>url</em>, true); +xmlhttp.onerror = function () { + console.log("** An error occurred during the transaction"); +}; +xmlhttp.send(); +</pre> + +<h2 id="仕様">仕様</h2> + +<table class="standard-table"> + <tbody> + <tr> + <th scope="col">仕様</th> + <th scope="col">ステータス</th> + <th scope="col">備考</th> + </tr> + <tr> + <td>{{SpecName('XMLHttpRequest', '#handler-xhr-onerror')}}</td> + <td>{{Spec2('XMLHttpRequest')}}</td> + <td>WHATWG living standard</td> + </tr> + </tbody> +</table> + +<h2 id="ブラウザーの互換性">ブラウザーの互換性</h2> + + + +<p>{{Compat("api.XMLHttpRequestEventTarget.onerror")}}</p> |
