If it is perfectly acceptable to put JavaScript right before </body>
what is a good reason to keep it in the <head>
?
Based on the question JavaScript in <head> or just before </body>?
many answers state that the page will load faster if you put it right before the </body>
tag.
However I don't see any sound arguments on why it should be kept in the <head>
. I'm asking because I am not a very strong JavaScript developer and from everything I've read and seen, the standard is to keep most JavaScript code and external references in the the <head>
.