In general, when we introduce JS file through SRC, we recommend introducing it at the end of the page because it blocks the rendering of the page. Defer and async can achieve the same effect
When the HTML parser encounters the <script> element, it must execute the script before resuming parsing and rendering of the document.
Script execution is designed to be synchronized and blocked by default, and we can add defer and async attributes to the script tag (not all browser support, of course)
Using the defer and Async properties, the browser can continue to parse and render documents while downloading scripts
If the label has both properties, the Defer property is automatically ignored when both the defer and async properties are supported
As follows:
<script defer src= "aa.js" ></script><script async src= "Bb.js" ></script>
Attention:
Deferred scripts are executed in the order in which they appear in the document, while asynchronous scripts execute after they are loaded (the order may be unordered).