Get to know MDN better
このページはコミュニティーの尽力で英語から翻訳されました。MDN Web Docs コミュニティーについてもっと知り、仲間になるにはこちらから。
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2015年7月.
XMLHttpRequest の responseText プロパティは読み取り専用で、送信されたリクエストに続いてサーバーから受け取ったテキストを返します。
文字列で、 XMLHttpRequest を使用して受信したテキストデータ、またはリクエストが失敗した場合もしくはまだコンテンツが受信されていない場合は "" です。
非同期リクエストを処理している間、 responseText の値は、データが完全に受信できておらず不完全であっても、常にサーバーから受信した現在のコンテンツを持ちます。
readyState の値が XMLHttpRequest.DONE (4) になり、 status の値が 200 ("OK") になった場合、コンテンツ全体が受信されたことが分かります。
XMLHttpRequest.responseType が空文字列または "text" のどちらにも設定されていません。 responseText プロパティはテキストコンテンツのみで有効なので、他の値はエラーの状態です。
| XMLHttpRequest # the-responsetext-attribute |
Enable JavaScript to view this browser compatibility table.
This page was last modified on 2025年9月4日 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.