In general, is it best place to external JavaScript and jQuery files in the head tags or before the closing body tag. I've read opinions that present arguments for both, so I'm confused as to which is the best way to go. I think the correct order is: (1) css stylesheet(s), (2) link to jQuery (e.g.,, and then (3) JavaScript files. (See also example below). Is this correct? Thanks!

<title>This is my Sample Page</title>

<!-- CSS goes before JavaScript -->
<link rel="stylesheet" type="text/css" href="main1.css" />
<script src=""></script>
<script type="text/javascript" src="myScript.js"></script>

$(document).ready(function() {
//JavaScript programming goes here