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() {
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() {
512512There 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.
You can’t perform that action at this time.
0 commit comments