When exactly are module scripts (<script type="module">) fetched and evaluated?
According to the Living Standard for HTML (October 22, 2017.):
For module scripts,
if the
asyncattribute is present,then the module script and all its dependencies will be fetched in parallel to parsing, and the module script will be evaluated as soon as it is available (potentially before parsing completes).
Otherwise,
the module script and its dependencies will be fetched in parallel to parsing and evaluated when the page has finished parsing. (The
deferattribute has no effect on module scripts.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With