File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
5-network/08-xmlhttprequest Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -93,7 +93,7 @@ xhr.onload = function() {
93
93
if (xhr.status != 200) { // analyze HTTP status of the response
94
94
alert(`Error ${xhr.status}: ${xhr.statusText}`); // e.g. 404: Not Found
95
95
} 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
97
97
}
98
98
};
99
99
@@ -512,7 +512,7 @@ xhr.onerror = function() {
512
512
There are actually more events, the [modern specification](http://www.w3.org/TR/XMLHttpRequest/#events) lists them (in the lifecycle order):
513
513
514
514
- `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 `.
516
516
- `abort` -- the request was canceled by the call `xhr.abort()`.
517
517
- `error` -- connection error has occurred, e.g. wrong domain name. Doesn't happen for HTTP-errors like 404.
518
518
- `load` -- the request has finished successfully.
You can’t perform that action at this time.
0 commit comments