diff options
author | Masahiro FUJIMOTO <mfujimot@gmail.com> | 2022-01-30 00:29:45 +0900 |
---|---|---|
committer | Masahiro FUJIMOTO <mfujimot@gmail.com> | 2022-02-05 13:19:57 +0900 |
commit | c826e72a7115f4e5d2e0a3cd19ddd843e1dfb9eb (patch) | |
tree | 6acaab7851e5ddf37ab4298fe7deb5ff9ae4ea43 /files/ja/web/api | |
parent | e2643f1e432d9bbeea573e0a61cba62c22eeda5f (diff) | |
download | translated-content-c826e72a7115f4e5d2e0a3cd19ddd843e1dfb9eb.tar.gz translated-content-c826e72a7115f4e5d2e0a3cd19ddd843e1dfb9eb.tar.bz2 translated-content-c826e72a7115f4e5d2e0a3cd19ddd843e1dfb9eb.zip |
2021/09/15 時点の英語版に同期
Diffstat (limited to 'files/ja/web/api')
-rw-r--r-- | files/ja/web/api/xmlhttprequest/error_event/index.md | 139 |
1 files changed, 62 insertions, 77 deletions
diff --git a/files/ja/web/api/xmlhttprequest/error_event/index.md b/files/ja/web/api/xmlhttprequest/error_event/index.md index 0563f46771..d1a6b33b86 100644 --- a/files/ja/web/api/xmlhttprequest/error_event/index.md +++ b/files/ja/web/api/xmlhttprequest/error_event/index.md @@ -4,57 +4,58 @@ slug: Web/API/XMLHttpRequest/error_event tags: - API - Error - - Event - - ProgressEvent - - Web - - XMLHttpRequest - イベント + - ProgressEvent - ウェブ + - XMLHttpRequest +browser-compat: api.XMLHttpRequest.error_event translation_of: Web/API/XMLHttpRequest/error_event --- -<div>{{APIRef}}</div> +{{APIRef}} -<p><code>error</code> イベントは、リクエストでエラーが発生したときに発生します。</p> +`error` イベントは、リクエストでエラーが発生したときに発行されます。 <table class="properties"> - <tbody> - <tr> - <th scope="row">バブリング</th> - <td>なし</td> - </tr> - <tr> - <th scope="row">キャンセル可能</th> - <td>いいえ</td> - </tr> - <tr> - <th scope="row">インターフェイス</th> - <td>{{domxref("ProgressEvent")}}</td> - </tr> - <tr> - <th scope="row">イベントハンドラープロパティ</th> - <td>{{domxref("XMLHttpRequestEventTarget/onerror", "onerror")}}</td> - </tr> - </tbody> + <tbody> + <tr> + <th scope="row">バブリング</th> + <td>なし</td> + </tr> + <tr> + <th scope="row">キャンセル</th> + <td>不可</td> + </tr> + <tr> + <th scope="row">インターフェイス</th> + <td>{{domxref("ProgressEvent")}}</td> + </tr> + <tr> + <th scope="row">イベントハンドラープロパティ</th> + <td> + {{domxref("XMLHttpRequestEventTarget/onerror", "onerror")}} + </td> + </tr> + </tbody> </table> -<h2 id="Examples" name="Examples">例</h2> +## 例 -<h3 id="Live_example" name="Live_example">ライブデモ</h3> +### ライブデモ -<h4 id="HTML">HTML</h4> +#### HTML -<pre class="brush: html"><div class="controls"> - <input class="xhr success" type="button" name="xhr" value="Click to start XHR (success)" /> - <input class="xhr error" type="button" name="xhr" value="Click to start XHR (error)" /> - <input class="xhr abort" type="button" name="xhr" value="Click to start XHR (abort)" /> -</div> - -<textarea readonly class="event-log"></textarea></pre> +```html +<div class="controls"> + <input class="xhr success" type="button" name="xhr" value="Click to start XHR (success)" /> + <input class="xhr error" type="button" name="xhr" value="Click to start XHR (error)" /> + <input class="xhr abort" type="button" name="xhr" value="Click to start XHR (abort)" /> +</div> -<div class="hidden"> -<h4 id="CSS">CSS</h4> +<textarea readonly class="event-log"></textarea> +``` -<pre class="brush: css">.event-log { +```css hidden +.event-log { width: 25rem; height: 4rem; border: 1px solid black; @@ -66,12 +67,12 @@ input { width: 11rem; margin: .5rem; } -</pre> -</div> +``` -<h4 id="JS">JS</h4> +#### JS -<pre class="brush: js">const xhrButtonSuccess = document.querySelector('.xhr.success'); +```js +const xhrButtonSuccess = document.querySelector('.xhr.success'); const xhrButtonError = document.querySelector('.xhr.error'); const xhrButtonAbort = document.querySelector('.xhr.abort'); const log = document.querySelector('.event-log'); @@ -99,48 +100,32 @@ function runXHR(url) { return xhr; } -xhrButtonSuccess.addEventListener('click', () => { - runXHR('https://mdn.mozillademos.org/files/16553/DgsZYJNXcAIPwzy.jpg'); +xhrButtonSuccess.addEventListener('click', () => { + runXHR('dgszyjnxcaipwzy.jpg'); }); -xhrButtonError.addEventListener('click', () => { +xhrButtonError.addEventListener('click', () => { runXHR('https://somewhere.org/i-dont-exist'); }); -xhrButtonAbort.addEventListener('click', () => { - runXHR('https://mdn.mozillademos.org/files/16553/DgsZYJNXcAIPwzy.jpg').abort(); -});</pre> - -<h4 id="Result" name="Result">結果</h4> - -<p>{{ EmbedLiveSample('Live_example', '100%', '150px') }}</p> - -<h2 id="Specifications" name="Specifications">仕様書</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('XMLHttpRequest', '#event-xhr-error')}}</td> - <td>{{Spec2('XMLHttpRequest')}}</td> - <td></td> - </tr> - </tbody> -</table> +xhrButtonAbort.addEventListener('click', () => { + runXHR('dgszyjnxcaipwzy.jpg').abort(); +}); +``` + +#### 結果 + +{{ EmbedLiveSample('Live_example', '100%', '150px') }} + +## 仕様書 + +{{Specifications}} -<h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザーの互換性</h2> +## ブラウザーの互換性 -<p>{{Compat("api.XMLHttpRequest.error_event")}}</p> +{{Compat}} -<h2 id="See_also" name="See_also">関連情報</h2> +## 関連情報 -<ul> - <li>関連イベント: {{domxref("XMLHttpRequest/loadstart_event", "loadstart")}}, {{domxref("XMLHttpRequest/load_event", "load")}}, {{domxref("XMLHttpRequest/progress_event", "progress")}}, {{domxref("XMLHttpRequest/loadend_event", "loadend")}}, {{domxref("XMLHttpRequest/abort_event", "abort")}}</li> - <li><a href="/ja/docs/Web/API/XMLHttpRequest/Using_XMLHttpRequest#Monitoring_progress">進捗の監視</a></li> -</ul> +- 関連イベント: {{domxref("XMLHttpRequest/loadstart_event", "loadstart")}}, {{domxref("XMLHttpRequest/load_event", "load")}}, {{domxref("XMLHttpRequest/progress_event", "progress")}}, {{domxref("XMLHttpRequest/loadend_event", "loadend")}}, {{domxref("XMLHttpRequest/abort_event", "abort")}} +- [進捗の監視](/ja/docs/Web/API/XMLHttpRequest/Using_XMLHttpRequest#monitoring_progress) |