From 3209b4d4ad9db0c919bdf60c01c219845fe5a250 Mon Sep 17 00:00:00 2001 From: Masahiro FUJIMOTO Date: Sat, 29 Jan 2022 01:41:41 +0900 Subject: XMLHttpRequest のプロパティの記事を移行 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/api/xmlhttprequest/readystate/index.html | 107 --------------------- 1 file changed, 107 deletions(-) delete mode 100644 files/ja/web/api/xmlhttprequest/readystate/index.html (limited to 'files/ja/web/api/xmlhttprequest/readystate/index.html') diff --git a/files/ja/web/api/xmlhttprequest/readystate/index.html b/files/ja/web/api/xmlhttprequest/readystate/index.html deleted file mode 100644 index 3f8f8568e7..0000000000 --- a/files/ja/web/api/xmlhttprequest/readystate/index.html +++ /dev/null @@ -1,107 +0,0 @@ ---- -title: XMLHttpRequest.readyState -slug: Web/API/XMLHttpRequest/readyState -tags: - - AJAX - - Property - - Reference - - XMLHttpRequest -translation_of: Web/API/XMLHttpRequest/readyState ---- -

{{APIRef('XMLHttpRequest')}}

- -

XMLHttpRequest.readyState プロパティは XMLHttpRequest クライアントの状態を返します。XHR クライアントは次の状態のいずれかをとります:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
状態説明
0UNSENTクライアントは作成済み。open() はまだ呼ばれていない。
1OPENEDopen() が呼び出し済み。
2HEADERS_RECEIVEDsend() が呼び出し済みで、ヘッダーとステータスが利用可能。
3LOADINGダウンロード中。responseText には部分データが入っている。
4DONE操作が完了した。
- -
-
UNSENT
-
XMLHttpRequest クライアントは作成済みだが、まだ open() メソッドは呼ばれていない。
-
OPENED
-
open() メソッドは実行済み。この状態の間は、リクエストヘッダーを setRequestHeader() メソッドを使ってセットできて、send() メソッドを呼び出して取得を開始できる。
-
HEADERS_RECEIVED
-
send() は呼び出し済みでレスポンスヘッダーを受け取り済み。
-
LOADING
-
レスポンスボディを受け取っている。ResponseType が "text" か空文字の場合、responseText はロードするごとに部分テキストを持つ。
-
DONE
-
取得操作が完了している。つまりデータ転送が完全に成功したか失敗したかどちらでもありうる。
-
- -
-

状態名は Internet Explorer 11 以前のバージョンと異なります。UNSENT, OPENED, HEADERS_RECEIVED, LOADING,DONE, の代わりに、READYSTATE_UNINITIALIZED (0), READYSTATE_LOADING (1), READYSTATE_LOADED (2), READYSTATE_INTERACTIVE (3) and READYSTATE_COMPLETE (4) が使われています。

-
- -

- -
var xhr = new XMLHttpRequest();
-console.log('UNSENT', xhr.readyState); // readyState will be 0
-
-xhr.open('GET', '/api', true);
-console.log('OPENED', xhr.readyState); // readyState will be 1
-
-xhr.onprogress = function () {
-    console.log('LOADING', xhr.readyState); // readyState will be 3
-};
-
-xhr.onload = function () {
-    console.log('DONE', xhr.readyState); // readyState will be 4
-};
-
-xhr.send(null);
-
- -

仕様

- - - - - - - - - - - - - - -
仕様書策定状況コメント
{{SpecName('XMLHttpRequest', '#states')}}{{Spec2('XMLHttpRequest')}}WHATWG living standard
- -

ブラウザ実装状況

- - - -

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

-- cgit v1.2.3-54-g00ecf