Java Reference
In-Depth Information
<script src="js/scripts.js"></script>
</body>
</html>
This will ensure that the page has finished loading before the JavaScript code is processed.
If you have a large amount of JavaScript (even after minification), there are further optim-
izations that can be made such as lazy loading and preloading. Lazy loading is the process
of loading just the critical code that will be needed right away, then loading any other code
later by dynamically inserting another script tag into the DOM. Preloading is the process
of loading any code that might be required on future pages. This way, the code will have
already been downloaded by the time the user visits the relevant page.
 
Search WWH ::




Custom Search