This commit is contained in:
Ilya Kantor 2019-07-23 22:52:01 +03:00
parent d3ccd26cc9
commit 33fe91b84f

View file

@ -504,7 +504,7 @@ So it's kind of unusable at "after loaded" stage, unlike other DOM methods we co
That was the downside.
Technically, when `document.write` is called while the browser is reading ("parsing") incoming HTML, and it writes something, the browser consumes it just as it were initially there, in the HTML text.
Technically, when `document.write` is called while the browser is reading ("parsing") incoming HTML, and it writes something, the browser consumes it just as if it were initially there, in the HTML text.
That gives us the upside -- it works blazingly fast, because there's *no DOM modification*. It writes directly into the page text, while the DOM is not yet built, and the browser puts it into DOM at generation-time.