Starting a thread about it here.
#FailedInterview #javascript #html
For example, CSS and other static assets are non-blocking.
However, JavaScript is blocking unless it's used with async or defer.
The browser fetches the resource first and then start the parsing.
However, fetching and parsing happens in parallel for multiple resources.
<head> or <body>?
<head> does first but that doesn't mean that <body> will wait for all the resources the load and execute first in <head>
No, stylesheets are loaded in parallel and it doesn't block the parsing, waiting for a stylesheets to load first.
Well, multiple scripts can be fetched in parallel but further parsing won't happen until the first one is fetched and executed.
Unless it's async or defer, it executes serially.
That's why it is recommended to put script tags inside body at the bottom, so page can be parsed.
Answers is Yes! They do. But browser has certain connection limits for loading content from a server in parallel and will load upto certain N number of resources from the same server.