Skip to content

Commit bfe9549

Browse files
committed
Improve xhr examples and reorder
1 parent 535884e commit bfe9549

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@
99
const xhr = new XMLHttpRequest();
1010
xhr.onreadystatechange = () => {
1111
if (xhr.readyState === XMLHttpRequest.DONE) {
12-
message.innerHTML = (xhr.status === 200 ?
13-
xhr.responseText : 'Error code: ' + xhr.status
14-
);
12+
message.innerHTML = xhr.status === 200 ?
13+
xhr.responseText : `Error code: ${xhr.status}`;
1514
}
1615
};
1716
xhr.open('GET', '/person', true);
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
const fs = require('fs');
44
const http = require('http');
55

6-
const index = fs.readFileSync('./3-xhr.html');
6+
const index = fs.readFileSync('./4-xhr.html');
77

88
http.createServer((req, res) => {
99
if (req.url === '/person') {

0 commit comments

Comments
 (0)