Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

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.