<!-- The defer attribute specifies that the script is executed when the page has finished parsing. Note: This only works for external scripts. --> <html> <head> <script defer type="text/javascript" src="/path/to/script.js"></script> ...
//A script that will not run until after the page has loaded <script src="demo.js" defer></script>
<script src="demo_defer.js" defer></script>
<script src="script.js" defer></script>