<p>I've recently read the Yahoo manifesto <a href="http://developer.yahoo.com/performance/rules.html#postload" rel="noreferrer">Best Practices for Speeding Up Your Web Site</a>. They recommend to put the JavaScript inclusion at the bottom of the HTML code when we can.</p>

<p>But where exactly and when?</p>

<p>Should we put it before closing <code>&lt;/html&gt;</code> or after ? And above all, when should we still put it in the <code>&lt;head&gt;</code> section?</p>

If you put it at the bottom, it loads last, hence speeding up the speed that the user can see the page. It does need to be before the final
```
</html>
```
though otherwise it won't be part of the DOM.
If the code is needed instantly though, then put it in the head.
It's best to put things like blog widgets at the bottom so that if they don't load, it doesn't affect the usability of the page.