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

JavaScript

Yixi Guan
Yixi Guan
7,927 Points

When to put jQuery link in <head>?

In this video, Dave put jQuery link in <head> then added ready() method in js file. If putting the link at the end of the body is the best practice, when do we need to put jQuery link in <head>, and why?

1 Answer

jakoblofgren
jakoblofgren
3,327 Points

Placing the script in the <head> tag and writing document.ready() is the same as placing the script at the bottom of the DOM, as far as I know. I suggest you look around on StackOverflow if you would like a more in-depth answer. /J