<head> section of the page on which it is used:
There are a few possible downsides to this:
- Page rendering may be halted until the script is loaded and executed.
- A script written in the
<head>may attempt to modify DOM elements that have not yet appeared on the page.
<script src="assets/scripts/prettify.js"></script> </body> </html>
…thus avoiding both issues.
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"> </script>
<head> section, or, preferably, at the bottom of the page:
Photograph by Tekke, used under a Creative Commons license
Enjoy this piece? I invite you to follow me at twitter.com/dudleystorey to learn more.