Skip to content

Commit 2ae8261

Browse files
authored
Merge pull request #1858 from leviding/patch-10
Fix: change responseText to response
2 parents 1d10422 + 3ffab46 commit 2ae8261

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

5-network/08-xmlhttprequest/article.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ xhr.onload = function() {
9393
if (xhr.status != 200) { // analyze HTTP status of the response
9494
alert(`Error ${xhr.status}: ${xhr.statusText}`); // e.g. 404: Not Found
9595
} else { // show the result
96-
alert(`Done, got ${xhr.response.length} bytes`); // responseText is the server
96+
alert(`Done, got ${xhr.response.length} bytes`); // response is the server
9797
}
9898
};
9999
@@ -512,7 +512,7 @@ xhr.onerror = function() {
512512
There are actually more events, the [modern specification](http://www.w3.org/TR/XMLHttpRequest/#events) lists them (in the lifecycle order):
513513
514514
- `loadstart` -- the request has started.
515-
- `progress` -- a data packet of the response has arrived, the whole response body at the moment is in `responseText`.
515+
- `progress` -- a data packet of the response has arrived, the whole response body at the moment is in `response`.
516516
- `abort` -- the request was canceled by the call `xhr.abort()`.
517517
- `error` -- connection error has occurred, e.g. wrong domain name. Doesn't happen for HTTP-errors like 404.
518518
- `load` -- the request has finished successfully.

0 commit comments

Comments
 (0)