The page loads not at once. There are stages and events that we’ll study here. All of them are pretty important for solid understanding.
The browser rendering is incremental. For example, when a large table is loading, the browser shows it’s top as fast as possible and then renders the rest of rows as they arrive.
That’s very convenient, especially on slow internet, so the browser tries to render as much as it can. But if it meets a
<script> tag, then the rendering stops until the script finishes loading and executing.
Usually, the page