diff --git a/2ech12.md b/3ech13.md
index e9028ff..3565983 100644
--- a/2ech12.md
+++ b/3ech13.md
@@ -1,30 +1,36 @@
-# Chapter 12JavaScript and the Browser
+# Chapter 13JavaScript and the Browser
 
-> The browser is a really hostile programming environment.
+> The dream behind the Web is of a common information space in which we communicate by sharing information. Its universality is essential: the fact that a hypertext link can point to anything, be it personal, local or global, be it draft or highly polished.
 > 
-> &lt;footer&gt;Douglas Crockford, &lt;cite&gt;The JavaScript Programming Language (video lecture)&lt;/cite&gt;&lt;/footer&gt;
+> &lt;footer&gt;Tim Berners-Lee, &lt;cite&gt;The World Wide Web: A very short personal history&lt;/cite&gt;&lt;/footer&gt;
 
-The next part of this book will talk about web browsers. Without web browsers, there would be no JavaScript. And even if there were, no one would ever have paid any attention to it.
+The next chapters of this book will talk about web browsers. Without web browsers, there would be no JavaScript. Or even if there were, no one would ever have paid any attention to it.
 
-Web technology has, from the start, been decentralized, not just technically but also in the way it has evolved. Various browser vendors have added new functionality in ad hoc and sometimes poorly thought out ways, which then sometimes ended up being adopted by others and finally set down as a standard.
+Web technology has, from the start, been decentralized, not just technically but also in the way it evolved. Various browser vendors have added new functionality in ad hoc and sometimes poorly thought out ways, which then, sometimes, ended up being adopted by others—and finally set down as a standard.
 
-This is both a blessing and a curse. On the one hand, it is empowering to not have a central party control a system but have it be improved by various parties working in loose collaboration (or, occasionally, open hostility). On the other hand, the haphazard way in which the Web was developed means that the resulting system is not exactly a shining example of internal consistency. In fact, some parts of it are downright messy and confusing.
+This is both a blessing and a curse. On the one hand, it is empowering to not have a central party control a system but have it be improved by various parties working in loose collaboration (or occasionally open hostility). On the other hand, the haphazard way in which the Web was developed means that the resulting system is not exactly a shining example of internal consistency. Some parts of it are downright confusing and poorly conceived.
 
 ## Networks and the Internet
 
 Computer networks have been around since the 1950s. If you put cables between two or more computers and allow them to send data back and forth through these cables, you can do all kinds of wonderful things.
 
-If connecting two machines in the same building allows us to do wonderful things, connecting machines all over the planet should be even better. The technology to start implementing this vision was developed in the 1980s, and the resulting network is called the _Internet_. It has lived up to its promise.
+And if connecting two machines in the same building allows us to do wonderful things, connecting machines all over the planet should be even better. The technology to start implementing this vision was developed in the 1980s, and the resulting network is called the _Internet_. It has lived up to its promise.
 
-A computer can use this network to spew bits at another computer. For any effective communication to arise out of this bit-spewing, the computers at both ends must know what the bits are supposed to represent. The meaning of any given sequence of bits depends entirely on the kind of thing that it is trying to express and on the encoding mechanism used.
+A computer can use this network to shoot bits at another computer. For any effective communication to arise out of this bit-shooting, the computers on both ends must know what the bits are supposed to represent. The meaning of any given sequence of bits depends entirely on the kind of thing that it is trying to express and on the encoding mechanism used.
 
 A _network protocol_ describes a style of communication over a network. There are protocols for sending email, for fetching email, for sharing files, or even for controlling computers that happen to be infected by malicious software.
 
-For example, a simple chat protocol might consist of one computer sending the bits that represent the text “CHAT?” to another machine and the other responding with “OK!” to confirm that it understands the protocol. They can then proceed to send each other strings of text, read the text sent by the other from the network, and display whatever they receive on their screens.
+For example, the HTTP protocol (_Hypertext Transfer Protocol_) is a protocol for retrieving named resources (chunks of information, such as web pages or pictures). It specifies that the side making the request should start with a line like this, naming the resource and the version of the protocol that it is trying to use.
 
-Most protocols are built on top of other protocols. Our example chat protocol treats the network as a streamlike device into which you can put bits and have them arrive at the correct destination in the correct order. Ensuring those things is already a rather difficult technical problem.
+```
+GET /index.html HTTP/1.1
+```
+
+There's a lot more rules about the way the requester can include more information in the request and the way the other side, which returns the resource, packages up its content. We'll look at HTTP in a little more detail in [Chapter 18](18_http.html).
+
+Most protocols are built on top of other protocols. HTTP treats the network as a streamlike device into which you can put bits and have them arrive at the correct destination in the correct order. As we saw in [Chapter 11](11_async.html), ensuring those things is already a rather difficult problem.
 
-The _Transmission Control Protocol_ (TCP) is a protocol that solves this problem. All Internet-connected devices “speak” it, and most communication on the Internet is built on top of it.
+The _Transmission Control Protocol_ (TCP) is a protocol that addresses this problem. All Internet-connected devices “speak” it, and most communication on the Internet is built on top of it.
 
 A TCP connection works as follows: one computer must be waiting, or _listening_, for other computers to start talking to it. To be able to listen for different kinds of communication at the same time on a single machine, each listener has a number (called a _port_) associated with it. Most protocols specify which port should be used by default. For example, when we want to send an email using the SMTP protocol, the machine through which we send it is expected to be listening on port 25.
 
@@ -36,34 +42,33 @@ Such a connection acts as a two-way pipe through which bits can flow—the machi
 
 The _World Wide Web_ (not to be confused with the Internet as a whole) is a set of protocols and formats that allow us to visit web pages in a browser. The “Web” part in the name refers to the fact that such pages can easily link to each other, thus connecting into a huge mesh that users can move through.
 
-To add content to the Web, all you need to do is connect a machine to the Internet, and have it listen on port 80, using the _Hypertext Transfer Protocol_ (HTTP). This protocol allows other computers to request documents over the network.
+To become part of the Web, all you need to do is connect a machine to the Internet, and have it listen on port 80 with the HTTP protocol, so that other computers can ask it for documents.
 
 Each document on the Web is named by a _Uniform Resource Locator_ (URL), which looks something like this:
 
 ```
-  http://eloquentjavascript.net/12_browser.html
+  http://eloquentjavascript.net/13_browser.html
  |      |                      |               |
  protocol       server               path
 ```
 
 The first part tells us that this URL uses the HTTP protocol (as opposed to, for example, encrypted HTTP, which would be _https://_). Then comes the part that identifies which server we are requesting the document from. Last is a path string that identifies the specific document (or _resource_) we are interested in.
 
-Each machine connected to the Internet gets a unique _IP address_, which looks something like `37.187.37.82`. You can use these directly as the server part of a URL. But lists of more or less random numbers are hard to remember and awkward to type, so you can instead register a _domain name_ to point toward a specific machine or set of machines. I registered _eloquentjavascript.net_ to point at the IP address of a machine I control and can thus use that domain name to serve web pages.
+Machines connected to the Internet get an _IP address_, which is a number that can be used to send messages to that machine, and looks something like `149.210.142.219` or `2001:4860:4860::8888`. But lists of more or less random numbers are hard to remember and awkward to type, so you can instead register a _domain name_ for a specific address or set of addresses. I registered _eloquentjavascript.net_ to point at the IP address of a machine I control and can thus use that domain name to serve web pages.
 
-If you type the previous URL into your browser's address bar, it will try to retrieve and display the document at that URL. First, your browser has to find out what address _eloquentjavascript.net_ refers to. Then, using the HTTP protocol, it makes a connection to the server at that address and asks for the resource _/12_browser.html_.
-
-We will take a closer look at the HTTP protocol in [Chapter 17](17_http.html#http).
+If you type the URL we saw into your browser's address bar, it will try to retrieve and display the document at that URL. First, your browser has to find out what address _eloquentjavascript.net_ refers to. Then, using the HTTP protocol, it will make a connection to the server at that address and ask for the resource _/13_browser.html_. If all goes well, the server sends back a document, which your browser then displays on your screen.
 
 ## HTML
 
 HTML, which stands for _Hypertext Markup Language_, is the document format used for web pages. An HTML document contains text, as well as _tags_ that give structure to the text, describing things such as links, paragraphs, and headings.
 
-A simple HTML document looks like this:
+A short HTML document might look like this:
 
 ```
 <!doctype html>
 <html>
   <head>
+    <meta charset="utf-8">
     <title>My home page</title>
   </head>
   <body>
@@ -75,19 +80,19 @@ A simple HTML document looks like this:
 </html>
 ```
 
-The tags, wrapped in angle brackets (`&lt;` and `&gt;`), provide information about the structure of the document. The other text is just plain text.
+The tags, wrapped in angle brackets (`&lt;` and `&gt;`, the symbols for _less than_ and _greater than_), provide information about the structure of the document. The other text is just plain text.
 
-The document starts with `&lt;!doctype html&gt;`, which tells the browser to interpret it as _modern_ HTML, as opposed to various dialects that were in use in the past.
+The document starts with `&lt;!doctype html&gt;`, which tells the browser to interpret the page as _modern_ HTML, as opposed to various dialects that were in use in the past.
 
-HTML documents have a head and a body. The head contains information _about_ the document, and the body contains the document itself. In this case, we first declared that the title of this document is “My home page” and then gave a document containing a heading (`&lt;h1&gt;`, meaning “heading 1”—`&lt;h2&gt;` to `&lt;h6&gt;` produce more minor headings) and two paragraphs (`&lt;p&gt;`).
+HTML documents have a head and a body. The head contains information _about_ the document, and the body contains the document itself. In this case, the head declares that the title of this document is “My home page” and that it uses the UTF-8 encoding, which is a way to encode Unicode text as binary data. The document's body contains a heading (`&lt;h1&gt;`, meaning “heading 1”—`&lt;h2&gt;` to `&lt;h6&gt;` produce more minor headings) and two paragraphs (`&lt;p&gt;`).
 
-Tags come in several forms. An element, such as the body, a paragraph, or a link, is started by an _opening tag_ like `&lt;p&gt;` and ended by a _closing tag_ like `&lt;/p&gt;`. Some opening tags, such as the one for the link (`&lt;a&gt;`), contain extra information in the form of `name="value"` pairs. These are called _attributes_. In this case, the destination of the link is indicated with `href="http://eloquentjavascript.net"`, where `href` stands for “hypertext reference”.
+Tags come in several forms. An element, such as the body, a paragraph, or a link, is started by an _opening tag_ like `&lt;p&gt;` and ended by a _closing tag_ like `&lt;/p&gt;`. Some opening tags, such as the one for the link (`&lt;a&gt;`), contain extra information in the form of `name="value"` pairs. These are called _attributes_. In this case, the destination of the link is indicated with `href="http://&lt;wbr&gt;eloquentjavascript.&lt;wbr&gt;net"`, where `href` stands for “hypertext reference”.
 
-Some kinds of tags do not enclose anything and thus do not need to be closed. An example of this would be `&lt;img src="http://example.com/image.jpg"&gt;`, which will display the image found at the given source URL.
+Some kinds of tags do not enclose anything and thus do not need to be closed. The metadata tag `&lt;meta charset="utf-8"&gt;` is an example of this.
 
 To be able to include angle brackets in the text of a document, even though they have a special meaning in HTML, yet another form of special notation has to be introduced. A plain opening angle bracket is written as `&lt;` (“less than”), and a closing bracket is written as `&gt;` (“greater than”). In HTML, an ampersand (`&`) character followed by a word and a semicolon (`;`) is called an _entity_, and will be replaced by the character it encodes.
 
-This is analogous to the way backslashes are used in JavaScript strings. Since this mechanism gives ampersand characters a special meaning, too, those need to be escaped as `&amp;`. Inside an attribute, which is wrapped in double quotes, `&quot;` can be used to insert an actual quote character.
+This is analogous to the way backslashes are used in JavaScript strings. Since this mechanism gives ampersand characters a special meaning, too, those need to be escaped as `&amp;`. Inside attribute values, which are wrapped in double quotes, `&quot;` can be used to insert an actual quote character.
 
 HTML is parsed in a remarkably error-tolerant way. When tags that should be there are missing, the browser reconstructs them. The way in which this is done has been standardized, and you can rely on all modern browsers to do it in the same way.
 
@@ -96,6 +101,7 @@ The following document will be treated just like the one shown previously:
 ```
 <!doctype html>
 
+<meta charset=utf-8>
 <title>My home page</title>
 
 <h1>My home page</h1>
@@ -104,11 +110,11 @@ The following document will be treated just like the one shown previously:
   <a href=http://eloquentjavascript.net>here</a>.
 ```
 
-The `&lt;html&gt;`, `&lt;head&gt;`, and `&lt;body&gt;` tags are gone completely. The browser knows that `&lt;title&gt;` belongs in a head, and that `&lt;h1&gt;` in a body. Furthermore, I am no longer explicitly closing the paragraphs since opening a new paragraph or ending the document will close them implicitly. The quotes around the link target are also gone.
+The `&lt;html&gt;`, `&lt;head&gt;`, and `&lt;body&gt;` tags are gone completely. The browser knows the `&lt;meta&gt;` and `&lt;title&gt;` belong in the head, and that `&lt;h1&gt;` means the body has started. Furthermore, I am no longer explicitly closing the paragraphs since opening a new paragraph or ending the document will close them implicitly. The quotes around the attribute values are also gone.
 
 This book will usually omit the `&lt;html&gt;`, `&lt;head&gt;`, and `&lt;body&gt;` tags from examples to keep them short and free of clutter. But I _will_ close tags and include quotes around attributes.
 
-I will also usually omit the doctype. This is not to be taken as an encouragement to omit doctype declarations. Browsers will often do ridiculous things when you forget them. You should consider doctypes implicitly present in examples, even when they are not actually shown in the text.
+I will also usually omit the doctype and `charset` declaration. This is not to be taken as an encouragement to drop these from HTML documents. Browsers will often do ridiculous things when you forget them. You should consider the doctype and the `charset` metadata implicitly present in examples, even when they are not actually shown in the text.
 
 ## HTML and JavaScript
 
@@ -119,7 +125,7 @@ In the context of this book, the most important HTML tag is `&lt;script&gt;`. Th
 <script>alert("hello!");</script>
 ```
 
-Such a script will run as soon as its `&lt;script&gt;` tag is encountered as the browser reads the HTML. The page shown earlier will pop up an `alert` dialog when opened.
+Such a script will run as soon as its `&lt;script&gt;` tag is encountered while the browser reads the HTML. This page will pop up a dialog when opened—the `alert` function resembles `prompt`, in that it pops up a little window, but only shows a message without asking for input.
 
 Including large programs directly in HTML documents is often impractical. The `&lt;script&gt;` tag can be given an `src` attribute in order to fetch a script file (a text file containing a JavaScript program) from a URL.
 
@@ -128,29 +134,31 @@ Including large programs directly in HTML documents is often impractical. The `&
 <script src="code/hello.js"></script>
 ```
 
-The _code/hello.js_ file included here contains the same simple program, `alert("hello!")`. When an HTML page references other URLs as part of itself, for example an image file or a script—web browsers will retrieve them immediately and include them in the page.
+The _code/hello.js_ file included here contains the same program—`alert("hello!")`. When an HTML page references other URLs as part of itself, for example an image file or a script—web browsers will retrieve them immediately and include them in the page.
 
 A script tag must always be closed with `&lt;/script&gt;`, even if it refers to a script file and doesn't contain any code. If you forget this, the rest of the page will be interpreted as part of the script.
 
-Some attributes can also contain a JavaScript program. The `&lt;button&gt;` tag shown next (which shows up as a button) has an `onclick` attribute, whose content will be run whenever the button is clicked.
+You can load ES modules (see [Chapter 10](10_modules.html#es)) in the browser by giving your script tag a `type="module"` attribute. Such modules can depend on other modules by using URLs relative to themselves as module names in `import` declarations.
+
+Some attributes can also contain a JavaScript program. The `&lt;button&gt;` tag shown next (which shows up as a button) has an `onclick` attribute. The attribute's value will be run whenever the button is clicked.
 
 ```
 <button onclick="alert('Boom!');">DO NOT PRESS</button>
 ```
 
-Note that I had to use single quotes for the string in the `onclick` attribute because double quotes are already used to quote the whole attribute. I could also have used `&quot;`, but that'd make the program harder to read.
+Note that I had to use single quotes for the string in the `onclick` attribute because double quotes are already used to quote the whole attribute. I could also have used `&quot;`.
 
 ## In the sandbox
 
 Running programs downloaded from the Internet is potentially dangerous. You do not know much about the people behind most sites you visit, and they do not necessarily mean well. Running programs by people who do not mean well is how you get your computer infected by viruses, your data stolen, and your accounts hacked.
 
-Yet the attraction of the Web is that you can surf it without necessarily trusting all the pages you visit. This is why browsers severely limit the things a JavaScript program may do: it can't look at the files on your computer or modify anything not related to the web page it was embedded in.
+Yet the attraction of the Web is that you can browse it without necessarily trusting all the pages you visit. This is why browsers severely limit the things a JavaScript program may do: it can't look at the files on your computer or modify anything not related to the web page it was embedded in.
 
-Isolating a programming environment in this way is called _sandboxing_, the idea being that the program is harmlessly playing in a sandbox. But you should imagine this particular kind of sandbox as having a cage of thick steel bars over it, which makes it somewhat different from your typical playground sandbox.
+Isolating a programming environment in this way is called _sandboxing_, the idea being that the program is harmlessly playing in a sandbox. But you should imagine this particular kind of sandbox as having a cage of thick steel bars over it, so that the programs playing in it can't actually get out.
 
 The hard part of sandboxing is allowing the programs enough room to be useful yet at the same time restricting them from doing anything dangerous. Lots of useful functionality, such as communicating with other servers or reading the content of the copy-paste clipboard, can also be used to do problematic, privacy-invading things.
 
-Every now and then, someone comes up with a new way to circumvent the limitations of a browser and do something harmful, ranging from leaking minor private information to taking over the whole machine that the browser runs on. The browser developers respond by fixing the hole, and all is well again—that is, until the next problem is discovered, and hopefully publicized, rather than secretly exploited by some government or mafia.
+Every now and then, someone comes up with a new way to circumvent the limitations of a browser and do something harmful, ranging from leaking minor private information to taking over the whole machine that the browser runs on. The browser developers respond by fixing the hole, and all is well again—until the next problem is discovered, and hopefully publicized, rather than secretly exploited by some government agency or mafia.
 
 ## Compatibility and the browser wars
 
@@ -158,8 +166,6 @@ In the early stages of the Web, a browser called Mosaic dominated the market. Af
 
 This was the dark age of compatibility, often called the _browser wars_. Web developers were left with not one unified Web but two or three incompatible platforms. To make things worse, the browsers in use around 2003 were all full of bugs, and of course the bugs were different for each browser. Life was hard for people writing web pages.
 
-Mozilla Firefox, a not-for-profit offshoot of Netscape, challenged Internet Explorer's hegemony in the late 2000s. Because Microsoft was not particularly interested in staying competitive at the time, Firefox took quite a chunk of market share away from it. Around the same time, Google introduced its Chrome browser, and Apple's Safari browser gained popularity, leading to a situation where there were four major players, rather than one.
-
-The new players had a more serious attitude toward standards and better engineering practices, leading to less incompatibility and fewer bugs. Microsoft, seeing its market share crumble, came around and adopted these attitudes. If you are starting to learn web development today, consider yourself lucky. The latest versions of the major browsers behave quite uniformly and have relatively few bugs.
+Mozilla Firefox, a not-for-profit offshoot of Netscape, challenged Internet Explorer's position in the late 2000s. Because Microsoft was not particularly interested in staying competitive at the time, Firefox took a lot of market share away from it. Around the same time, Google introduced its Chrome browser, and Apple's Safari browser gained popularity, leading to a situation where there were four major players, rather than one.
 
-That is not to say that the situation is perfect just yet. Some of the people using the Web are, for reasons of inertia or corporate policy, stuck with very old browsers. Until those browsers die out entirely, writing websites that work for them will require a lot of arcane knowledge about their shortcomings and quirks. This book is not about those quirks. Rather, it aims to present the modern, sane style of web programming.
+The new players had a more serious attitude toward standards and better engineering practices, giving us less incompatibility and fewer bugs. Microsoft, seeing its market share crumble, came around and adopted these attitudes in its Edge browser, which replaces Internet Explorer. If you are starting to learn web development today, consider yourself lucky. The latest versions of the major browsers behave quite uniformly and have relatively few bugs.
