From b00755c73598fec568bc4a89c97786b3a0de61c1 Mon Sep 17 00:00:00 2001 From: Masahiro FUJIMOTO Date: Sun, 30 Jan 2022 00:42:56 +0900 Subject: 2021/09/15 時点の英語版に同期 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/xmlhttprequest/loadstart_event/index.md | 143 ++++++++++----------- 1 file changed, 65 insertions(+), 78 deletions(-) (limited to 'files/ja') diff --git a/files/ja/web/api/xmlhttprequest/loadstart_event/index.md b/files/ja/web/api/xmlhttprequest/loadstart_event/index.md index 5652e0d5bb..f1028c41c5 100644 --- a/files/ja/web/api/xmlhttprequest/loadstart_event/index.md +++ b/files/ja/web/api/xmlhttprequest/loadstart_event/index.md @@ -3,59 +3,62 @@ title: 'XMLHttpRequest: loadstart イベント' slug: Web/API/XMLHttpRequest/loadstart_event tags: - API - - Event + - イベント + - NeedsCompatTable + - NeedsSpecTable - ProgressEvent - - Web + - ウェブ - XMLHttpRequest - - events - - loadstart - イベント - - ウェブ + - loadstart +browser-compat: api.XMLHttpRequest.loadstart_event translation_of: Web/API/XMLHttpRequest/loadstart_event --- -
{{APIRef}}
+{{APIRef}} -

loadstart イベントは、リクエストがデータを読み込み始めたときに発生します。

+**`loadstart`** イベントは、リクエストがデータを読み込み始めたときに発生します。 - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + +
バブリングなし
キャンセル可能不可
インターフェイス{{domxref("ProgressEvent")}}
イベントハンドラープロパティ{{domxref("XMLHttpRequestEventTarget/onloadstart", "onloadstart")}}
バブリングなし
キャンセル不可
インターフェイス{{domxref("ProgressEvent")}}
イベントハンドラープロパティ + {{domxref("XMLHttpRequestEventTarget/onloadstart", "onloadstart")}} +
-

- -

ライブデモ

+## 例 -

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>
+#### HTML
 
-<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 +103,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();
-});
- -

結果

- -

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

- -

仕様書

- - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName('XMLHttpRequest', '#event-xhr-loadstart')}}{{Spec2('XMLHttpRequest')}}
+xhrButtonAbort.addEventListener('click', () => { + runXHR('dgszyjnxcaipwzy.jpg').abort(); +}); +``` + +#### 結果 + +{{ EmbedLiveSample('Live_example', '100%', '150px') }} + +## 仕様書 + +{{Specifications}} -

ブラウザーの互換性

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

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

+{{Compat}} -

関連情報

+## 関連情報 - +- 関連イベント: {{domxref("XMLHttpRequest/loadend_event", "loadend")}}, {{domxref("XMLHttpRequest/load_event", "load")}}, {{domxref("XMLHttpRequest/progress_event", "progress")}}, {{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