To load scripts asynchronously with JavaScript, we use the async
or defer
attributes.
For instance, we write
<script async src="script.js" onload="myInit()"></script>
or
<script defer src="script.js" onload="myInit()"></script>
to load script.js asynchronously.