I’ve read that it is better to keep all of your JavaScript files on the bottom of the webpage. The HTML5 Boilerplate template seems to agree: http://html5boilerplate.com/
And seems to be widely used.
My question is: first, does this have any real basis? I’ve done testing in Firebug and it seems to have some small effect, but is it trivial? Images and other sources don’t seem to start loading until CSS files and script files have loaded, but sticking them on the bottom doesn’t seem to make much difference in this at all.
It is very important for best practice reasons.
When you have scripts loading in your header, they stop other downloads from taking place! This includes your styling, and will also stop your images from downloading until the script has finished.
This is because JavaScript files load synchronously.
Also note that you will get a flash of unstyled content (FOUT) during loading if you do not move your JavaScript files to the bottom of your page. This is because your CSS will not download until the script has finished loading.
Here is an excerpt from Yahoo performance rule 6.
References
http://developer.yahoo.com/performance/rules.html/
Especially note rule 6.