From cce52bf16d6ae148999c2bdc61ddbb99c8f70664 Mon Sep 17 00:00:00 2001 From: Masahiro FUJIMOTO Date: Sun, 30 Jan 2022 00:47:54 +0900 Subject: 2021/09/15 時点の英語版に同期 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/api/xmlhttprequest/progress_event/index.md | 143 +++++++++------------ 1 file changed, 64 insertions(+), 79 deletions(-) diff --git a/files/ja/web/api/xmlhttprequest/progress_event/index.md b/files/ja/web/api/xmlhttprequest/progress_event/index.md index ac988ffdfc..786cf34e03 100644 --- a/files/ja/web/api/xmlhttprequest/progress_event/index.md +++ b/files/ja/web/api/xmlhttprequest/progress_event/index.md @@ -3,59 +3,60 @@ title: 'XMLHttpRequest: progress イベント' slug: Web/API/XMLHttpRequest/progress_event tags: - API - - Event + - イベント - ProgressEvent - - Reference - - Web + - リファレンス + - ウェブ - XMLHttpRequest - progress - - イベント - - ウェブ +browser-compat: api.XMLHttpRequest.progress_event translation_of: Web/API/XMLHttpRequest/progress_event --- -
{{APIRef}}
+{{APIRef}} -

progress イベントは、リクエストがもっとデータを受信した際に定期的に発生します。

+**`progress`** イベントは、リクエストがもっとデータを受信した際に定期的に発行されます。 - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + +
バブリングなし
キャンセル可能いいえ
インターフェイス{{domxref("ProgressEvent")}}
イベントハンドラープロパティ{{domxref("XMLHttpRequestEventTarget/onprogress", "onprogress")}}
バブリングなし
キャンセル可能不可
インターフェイス{{domxref("ProgressEvent")}}
イベントハンドラープロパティ + {{domxref("XMLHttpRequestEventTarget/onprogress", "onprogress")}} +
-

+## 例 -

ライブデモ

+### ライブデモ -

HTML

+#### 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>
+```html +
+ + + +
- +``` -

JS

+#### 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');
@@ -100,48 +101,32 @@ function runXHR(url) {
     return xhr;
 }
 
-xhrButtonSuccess.addEventListener('click', () => {
-    runXHR('https://mdn.mozillademos.org/files/16553/DgsZYJNXcAIPwzy.jpg');
+xhrButtonSuccess.addEventListener('click', () => {
+    runXHR('https://raw.githubusercontent.com/mdn/content/main/files/en-us/_wikihistory.json');
 });
 
-xhrButtonError.addEventListener('click', () => {
-    runXHR('https://somewhere.org/i-dont-exist');
+xhrButtonError.addEventListener('click', () => {
+    runXHR('http://i-dont-exist');
 });
 
-xhrButtonAbort.addEventListener('click', () => {
-    runXHR('https://mdn.mozillademos.org/files/16553/DgsZYJNXcAIPwzy.jpg').abort();
-});
- -

結果

- -

{{ EmbedLiveSample('Live_example', '100%', '150px') }}

- -

仕様書

- - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName('XMLHttpRequest', '#event-xhr-progress')}}{{Spec2('XMLHttpRequest')}} 
+xhrButtonAbort.addEventListener('click', () => { + runXHR('https://raw.githubusercontent.com/mdn/content/main/files/en-us/_wikihistory.json').abort(); +}); +``` + +#### 結果 + +{{ EmbedLiveSample('Live_example', '100%', '150px') }} + +## 仕様書 + +{{Specifications}} -

ブラウザーの対応

+## ブラウザーの互換性 -

{{Compat("api.XMLHttpRequest.progress_event")}}

+{{Compat}} -

関連情報

+## 関連情報 - +- 関連イベント: {{domxref("XMLHttpRequest/loadstart_event", "loadstart")}}, {{domxref("XMLHttpRequest/load_event", "load")}}, {{domxref("XMLHttpRequest/loadend_event", "loadend")}}, {{domxref("XMLHttpRequest/error_event", "error")}}, {{domxref("XMLHttpRequest/abort_event", "abort")}} +- [進捗の監視](/ja/docs/Web/API/XMLHttpRequest/Using_XMLHttpRequest#monitoring_progress) -- cgit v1.2.3-54-g00ecf