async attribute or the
This behavior is therefore render-blocking and can delay the overall page load if many and/or large resources need to be fetched.
<script async src="/assets/js/bootstrap.min.js"></script>
In the asynchronous way, the
async attribute need to be added to the
<script> tag. This way, the script is fetched asynchronous without blocking the parser. Once the script is fetched, the parsing is paused to execute the script.
<script defer src="/assets/js/bootstrap.min.js"></script>
In the deferred way, you need, like in the async way, add an attribute (
defer) to the
<script> tag. In this way, the script is fetched in the same way as in the asynchronous one, but doesn’t get executed until the parser has finished.