Most of javascript and web development books/articles says that you must put CSS in the head tag and javascript at the bottom of the page.
But when I open html source of famous websites such as this one stackoverflow, I find they put some js files in the head tag.
What’s Pros and Cons of both approaches and when to use which?
Found another question for the same issue:
Where should I declare JavaScript files used in my page? In <head></head> or near </body>?
From Yahoo’s Best Practices for Speeding Up Your Web Site:
Therefore, in general, it is preferrable to put them at the bottom. However, it isn’t always possible, and it often doesn’t make that much of a difference anyway.