@@ -74,7 +74,7 @@ it to `DELETE` its main page, it'll probably refuse.
7474
7575{{index [ path, URL] , GitHub}}
7676
77- The part after the ((method)) name is the path of the ((resource)) the
77+ The part after the ((method)) name is the path of the _ ((resource))_ the
7878request applies to. In the simplest case, a resource is simply a
7979((file)) on the ((server)), but the protocol doesn't require it to be.
8080A resource may be anything that can be transferred _ as if_ it is a
@@ -89,7 +89,7 @@ After the resource path, the first line of the request mentions
8989is using.
9090
9191In practice, many sites use HTTP version 2, which supports the same
92- concepts as version 1.1, but is a lot more complicated so that it can
92+ concepts as version 1.1 but is a lot more complicated so that it can
9393be faster. Browsers will automatically switch to the appropriate
9494protocol version when talking to a given server, and the outcome of a
9595request is the same regardless which version is used. Because version
@@ -230,7 +230,7 @@ console.log(decodeURIComponent("Yes%3F"));
230230If we change the ` method ` attribute of the HTML form in the example we
231231saw earlier to ` POST ` , the ((HTTP)) request made to submit the
232232((form)) will use the ` POST ` method and put the ((query string)) in
233- body of the request, rather than adding it to the URL.
233+ the body of the request, rather than adding it to the URL.
234234
235235``` {lang: http}
236236POST /example/message.html HTTP/1.1
@@ -275,21 +275,21 @@ fetch("example/data.txt").then(response => {
275275Calling ` fetch ` returns a promise that resolves to a ` Response ` object
276276holding information about the server's response, such as its status
277277code and its headers. The headers are wrapped in a ` Map ` -like object
278- that treats its keys (the header names) as case- insensitive, because
278+ that treats its keys (the header names) as case insensitive, because
279279header names are not supposed to be case sensitive. This means that
280280` headers.get("Content-Type") ` and ` headers.get("content-TYPE") ` will
281281return the same value.
282282
283283Note that the promise returned by ` fetch ` resolves successfully even
284284if the server responded with an error code. It _ might_ also be
285- rejected, if there is a network error or the ((server)) that the
285+ rejected, if there is a network error or if the ((server)) that the
286286request is addressed to can't be found.
287287
288288{{index [ path, URL] , "relative URL"}}
289289
290290The first argument to ` fetch ` is the URL that should be requested.
291291When that ((URL)) doesn't start with a protocol name (such as _ http:_ )
292- it is treated as relative , which means that it is interpreted relative
292+ it is treated as _ relative _ , which means it is interpreted relative
293293to the current document. When it starts with a slash (/), it replaces
294294the current path, which is the part after the server name. When it
295295does not, the part of the current path up to and including its last
@@ -317,7 +317,7 @@ rejects if it's not valid JSON.
317317
318318{{index "GET method", "body (HTTP)", "DELETE method", "method property"}}
319319
320- By default, ` fetch ` uses the ` GET ` method to make its request, and
320+ By default, ` fetch ` uses the ` GET ` method to make its request and
321321does not include a request body. You can configure it differently by
322322passing an object with extra options as a second argument. For
323323example, this request tries to delete ` example/data.txt ` .
@@ -374,7 +374,7 @@ _mybank.com_).
374374
375375{{index "Access-Control-Allow-Origin header", "cross-domain request"}}
376376
377- This can be an annoying problem when building systems that wants to
377+ This can be an annoying problem when building systems that want to
378378access several domains for legitimate reasons. Fortunately,
379379((server))s can include a ((header)) like this in their ((response))
380380to explicitly indicate to the browser that it is okay for the request
@@ -430,7 +430,7 @@ server interface around.
430430
431431Data traveling over the Internet tends to follow a long, dangerous
432432road. To get to its destination, it must hop through anything from
433- coffee-shop Wi-Fi to ((network))s controlled by various companies and
433+ coffee-shop Wi-Fi hotspots to ((network))s controlled by various companies and
434434states. At any point along its route it may be inspected or even
435435modified.
436436
@@ -445,16 +445,16 @@ to via your bank's website, plain HTTP is not good enough.
445445
446446{{indexsee "Secure HTTP", HTTPS}}
447447
448- The secure ((HTTP)) protocol, whose ((URL))s start with _ https://_ ,
448+ The secure ((HTTP)) protocol, used for ((URL))s start with _ https://_ ,
449449wraps HTTP traffic in a way that makes it harder to read and tamper
450450with. Before exchanging data, the client verifies that the server is
451- who it claims to be, by asking it to prove that it has a cryptographic
451+ who it claims to be by asking it to prove that it has a cryptographic
452452((certificate)) issued by a certificate authority that the ((browser))
453453recognizes. Next, all data going over the ((connection)) is encrypted
454454in a way that should prevent eavesdropping and tampering.
455455
456- Thus, when it works right, ((HTTPS)) prevents both the someone
457- impersonating the website you were trying to talk to and the someone
456+ Thus, when it works right, ((HTTPS)) prevents other people from
457+ impersonating the website you are trying to talk to and from
458458snooping on your communication. It is not perfect, and there have been
459459various incidents where HTTPS failed because of forged or stolen
460460certificates and broken software, but it is a _ lot_ safer than plain
@@ -564,7 +564,7 @@ predefined options.
564564
565565Such a field looks like this:
566566
567- {{figure {url: "img/form_select.png", alt: "A select field",width: "4cm"}}}
567+ {{figure {url: "img/form_select.png", alt: "A select field", width: "4cm"}}}
568568
569569if}}
570570
@@ -636,7 +636,7 @@ the OK button, rather than going through the help link first:
636636{{index "tabindex attribute"}}
637637
638638By default, most types of HTML elements cannot be focused. But you can
639- add a ` tabindex ` attribute to any element, which will make it
639+ add a ` tabindex ` attribute to any element that will make it
640640focusable. A ` tabindex ` of -1 makes tabbing skip over an element, even
641641if it is normally focusable.
642642
665665{{index "user experience", "asynchronous programming"}}
666666
667667When a program is
668- in the process of handling an action caused by some ((button)) or other control,
669- which might require communication with the server and thus take a
668+ in the process of handling an action caused by some ((button)) or other control
669+ that might require communication with the server and thus take a
670670while, it can be a good idea to
671671disable the control until the action finishes. That way, when the user
672672gets impatient and clicks it again, they don't accidentally repeat
@@ -1104,7 +1104,7 @@ prevents the feature from eating up too much space.
11041104{{index "localStorage object", "note-taking example", "select (HTML tag)", "button (HTML tag)", "textarea (HTML tag)"}}
11051105
11061106The following code implements a crude note-taking application. It
1107- keeps a set of named notes, and allows the user to edit notes and
1107+ keeps a set of named notes and allows the user to edit notes and
11081108create new ones.
11091109
11101110``` {lang: "text/html", startCode: true}
@@ -1165,19 +1165,19 @@ exist from `localStorage` will yield `null`. Passing `null` to
11651165Thus, the ` || ` operator can be used to provide a default value in a
11661166situation like this.
11671167
1168- The ` setState ` method makes sure the DOM is showing a given state, and
1168+ The ` setState ` method makes sure the DOM is showing a given state and
11691169stores the new state to ` localStorage ` . Event handlers call this
11701170function to move to a new state.
11711171
11721172{{index "Object.assign function", object, property, "computed property"}}
11731173
11741174The use of ` Object.assign ` in the example is intended to create a new
11751175object that is a clone of the old ` state.notes ` , but with one property
1176- added or overwritten. ` Object.assign ` takes its first argument, and
1176+ added or overwritten. ` Object.assign ` takes its first argument and
11771177adds all properties from any further arguments to it. Thus, giving it
11781178an empty object will cause it to fill a fresh object. The ((square
11791179brackets)) notation in the third argument is used to create a property
1180- whose names is based on some dynamic value.
1180+ whose name is based on some dynamic value.
11811181
11821182{{index "sessionStorage object"}}
11831183
@@ -1229,7 +1229,7 @@ file picker field, the `FileReader` interface can be used to access
12291229the content of this file from a JavaScript program.
12301230
12311231The ` localStorage ` and ` sessionStorage ` objects can be used to save
1232- information in a way that survives page reloads. The first saves the
1232+ information in a way that survives page reloads. The first object saves the
12331233data forever (or until the user decides to clear it), and the second
12341234saves it until the browser is closed.
12351235
@@ -1239,7 +1239,7 @@ saves it until the browser is closed.
12391239
12401240{{index "Accept header", "media type", "document format", "content negotiation (exercise)"}}
12411241
1242- One of the things that HTTP can do is called _ content negotiation_ .
1242+ One of the things HTTP can do is called _ content negotiation_ .
12431243The ` Accept ` request header is used to tell the server what type of
12441244document the client would like to get. Many servers ignore this
12451245header, but when a server knows of various ways to encode a resource,
@@ -1295,7 +1295,7 @@ JavaScript code.
12951295
12961296{{index "textarea (HTML tag)", "button (HTML tag)", "Function constructor", "error message"}}
12971297
1298- Put a button next to a ` <textarea> ` field, which , when pressed, uses
1298+ Put a button next to a ` <textarea> ` field that , when pressed, uses
12991299the ` Function ` constructor we saw in [ Chapter ?] ( modules#eval ) to wrap
13001300the text in a function and call it. Convert the return value of the
13011301function, or any error it raises, to a string and display it below the
@@ -1327,7 +1327,7 @@ property of the text field and call `Function` on it.
13271327{{index "try keyword", "exception handling"}}
13281328
13291329Make sure you wrap both the call to ` Function ` and the call to its
1330- result in a ` try ` block so that you can catch exceptions that it
1330+ result in a ` try ` block so you can catch the exceptions it
13311331produces. In this case, we really don't know what type of exception we
13321332are looking for, so catch everything.
13331333
@@ -1346,7 +1346,7 @@ hint}}
13461346{{index "game of life (exercise)", "artificial life", "Conway's Game of Life"}}
13471347
13481348Conway's Game of Life is a simple ((simulation)) that creates
1349- artificial "life" on a ((grid)), each cell of which is either live or
1349+ artificial "life" on a ((grid)), each cell of which is either alive or
13501350not. Each ((generation)) (turn), the following rules are applied:
13511351
13521352* Any live ((cell)) with fewer than two or more than three live
@@ -1357,7 +1357,7 @@ not. Each ((generation)) (turn), the following rules are applied:
13571357
13581358* Any dead cell with exactly three live neighbors becomes a live cell.
13591359
1360- A neighbor is defined as any adjacent cell, including diagonally
1360+ A _ neighbor _ is defined as any adjacent cell, including diagonally
13611361adjacent ones.
13621362
13631363{{index "pure function"}}
@@ -1407,7 +1407,7 @@ center, whose neighbors we are counting.
14071407
14081408{{index "event handling", "change event"}}
14091409
1410- Making changes to ((checkbox))es take effect on the next generation
1410+ Ensuring that changes to ((checkbox))es take effect on the next generation
14111411can be done in two ways. An event handler could notice these changes
14121412and update the current grid to reflect them, or you could generate a
14131413fresh grid from the values in the checkboxes before computing the next
0 commit comments