Skip to content

Commit 3b06ab3

Browse files
committed
ws draft
1 parent 1985d1c commit 3b06ab3

File tree

4 files changed

+555
-4
lines changed

4 files changed

+555
-4
lines changed

7-network/07-xmlhttprequest/article.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,6 @@ In the old scripts you may also find `xhr.responseText` and even `xhr.responseXM
174174
They exist for historical reasons, to get either a string or XML document. Nowadays, we should set the format in `xhr.responseType` and get `xhr.response` as demonstrated above.
175175
```
176176

177-
178-
179177
## Ready states
180178

181179
`XMLHttpRequest` changes between states as it progresses. The current state is accessible as `xhr.readyState`.
@@ -447,7 +445,7 @@ function upload(file) {
447445

448446
## Cross-origin requests
449447

450-
`XMLHttpRequest` can make cross-domain requests, using the same CORS policy as `fetch`.
448+
`XMLHttpRequest` can make cross-domain requests, using the same CORS policy as [fetch](info:fetch-crossorigin).
451449

452450
Just like `fetch`, it doesn't send cookies and HTTP-authorization to another origin by default. To enable them, set `xhr.withCredentials` to `true`:
453451
@@ -456,7 +454,7 @@ let xhr = new XMLHttpRequest();
456454
*!*
457455
xhr.withCredentials = true;
458456
*/!*
459-
s
457+
460458
xhr.open('POST', 'http://anywhere.com/request');
461459
...
462460
```

0 commit comments

Comments
 (0)