diff options
| author | Masahiro FUJIMOTO <mfujimot@gmail.com> | 2022-01-29 01:41:41 +0900 |
|---|---|---|
| committer | Masahiro FUJIMOTO <mfujimot@gmail.com> | 2022-02-05 13:19:25 +0900 |
| commit | 3209b4d4ad9db0c919bdf60c01c219845fe5a250 (patch) | |
| tree | eb101ee0b55b2b885d2ccde8c2d90dab7e60532d /files/ja/web/api/xmlhttprequest/responsetext/index.html | |
| parent | 1e5d0f7fe35befbbdd08f5c9b3b4eafd42975ae8 (diff) | |
| download | translated-content-3209b4d4ad9db0c919bdf60c01c219845fe5a250.tar.gz translated-content-3209b4d4ad9db0c919bdf60c01c219845fe5a250.tar.bz2 translated-content-3209b4d4ad9db0c919bdf60c01c219845fe5a250.zip | |
XMLHttpRequest のプロパティの記事を移行
Diffstat (limited to 'files/ja/web/api/xmlhttprequest/responsetext/index.html')
| -rw-r--r-- | files/ja/web/api/xmlhttprequest/responsetext/index.html | 81 |
1 files changed, 0 insertions, 81 deletions
diff --git a/files/ja/web/api/xmlhttprequest/responsetext/index.html b/files/ja/web/api/xmlhttprequest/responsetext/index.html deleted file mode 100644 index e19cca99f4..0000000000 --- a/files/ja/web/api/xmlhttprequest/responsetext/index.html +++ /dev/null @@ -1,81 +0,0 @@ ---- -title: XMLHttpRequest.responseText -slug: Web/API/XMLHttpRequest/responseText -tags: - - API - - Fetching Text - - Loading Text - - Property - - Read-only - - Reference - - XMLHttpRequest - - responseText - - プロパティ -translation_of: Web/API/XMLHttpRequest/responseText ---- -<div>{{draft}}</div> - -<div>{{APIRef('XMLHttpRequest')}}</div> - -<p><span class="seoSummary">{{domxref("XMLHttpRequest")}} の <strong><code>responseText</code></strong> プロパティは読み取り専用で、送信されたリクエストに続いてサーバーから受け取ったテキストを返します。</span></p> - -<h2 id="Syntax" name="Syntax">構文</h2> - -<pre class="syntaxbox">var <var>resultText</var> = <var>XMLHttpRequest</var>.responseText;</pre> - -<h3 id="Value" name="Value">値</h3> - -<p>{{domxref("DOMString")}} で、 <code>XMLHttpRequest</code> を使用して受信したテキストデータ、またはリクエストが失敗したときは <code>null</code>、またはリクエストがまだ {{domxref("XMLHttpRequest.send", "send()")}} の呼び出しによって送信されていない場合は <code>""</code>。</p> - -<p>非同期リクエストを処理している間、 <code>responseText</code> の値は、データが完全に受信できておらず不完全であっても、常にサーバーから受信した現在のコンテンツを持ちます。</p> - -<p>{{domxref("XMLHttpRequest.readyState", "readyState")}} の値が {{domxref("XMLHttpRequest.DONE", "XMLHttpRequest.DONE")}} (<code>4</code>) になり、 {{domxref("XMLHttpRequest.status", "status")}} の値が 200 (<code>"OK"</code>) になった場合、コンテンツ全体が受信されたことが分かります。</p> - -<h3 id="Exceptions" name="Exceptions">例外</h3> - -<dl> - <dt><code>InvalidStateError</code></dt> - <dd>{{domxref("XMLHttpRequest.responseType")}} が空文字列または <code>"text"</code> のどちらにも設定されていません。 <code>responseText</code> プロパティはテキストコンテンツのみで有効なので、他の値はエラーの状態です。</dd> -</dl> - -<h2 id="Example" name="Example">例</h2> - -<pre class="brush: js">var xhr = new XMLHttpRequest(); -xhr.open('GET', '/server', true); - -// If specified, responseType must be empty string or "text" -xhr.responseType = 'text'; - -xhr.onload = function () { - if (xhr.readyState === xhr.DONE) { - if (xhr.status === 200) { - console.log(xhr.response); - console.log(xhr.responseText); - } - } -}; - -xhr.send(null);</pre> - -<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', '#the-responsetext-attribute')}}</td> - <td>{{Spec2('XMLHttpRequest')}}</td> - <td>WHATWG living standard</td> - </tr> - </tbody> -</table> - -<h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザーの互換性</h2> - -<p>{{Compat("api.XMLHttpRequest.responseText")}}</p> |
