Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

WordPress From Bootstrap to WordPress Setup a Bootstrap Theme Add Bootstrap JS via the functions.php File

Why don't load jQuery files in the footer of the site as what assumed to be the best practice?

In the video you put jQuery files link in the head section in order to make sure that it appears before bootstrap.min.js

Christopher Denny
Christopher Denny
10,460 Points

There are two good practices: 1) Keeping it in the header then telling it to run on document ready, or 2) Place it at the end of the body.

1 Answer

From what I read from stackoverflow, you load jQuery at the top because there might be plugins that add inline jQuery code at the head. I would assume a plugin that adds Google tracking code to the beginning of the head would be one case, but not sure if that uses jQuery.