Script defer
The defer attribute downloads the script in parallel with HTML parsing but delays execution until parsing is complete.
Deferred scripts execute in order, making defer safer than async for interdependent scripts.
The defer attribute downloads the script in parallel with HTML parsing but delays execution until parsing is complete.
Deferred scripts execute in order, making defer safer than async for interdependent scripts.
<head>
<!-- Downloads in parallel, runs after DOM is ready, in order -->
<script defer src="jquery.js"></script>
<script defer src="app.js"></script>
</head>
Use defer for your main application scripts — it is safer than async and avoids blocking rendering.