If the script is inline (e.g. not dynamically loaded) and not marked defer
or async
, then the script must be processed synchronously in order and the browser cannot proceed without it. Inline <script>
tags (without any special attributes) are processed in order as encountered and the browser MUST process them that way.
If you want your page to render without waiting for the script to load, then you can either load it dynamically or you can mark it async
or put the <script>
tag right before the </body>
tag and the page rendering will not wait for it. If using defer
or async
, you must make sure that no other scripts are dependent upon the loading of this script, otherwise they might run before this one loads.
See these references for more info: