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.

JavaScript jQuery Basics Understanding jQuery Events and DOM Traversal Adding jQuery to a Project

David Lacho
David Lacho
20,864 Points

jQuery file not included in js folder in workspaces

The video states that the jQuery file has already been added to the js file in workspaces, but it's not there.

1 Answer

Dear davidlacho, in case the jQuery file is not added, add this piece of code to the index.html:

<script
  src="https://code.jquery.com/jquery-3.2.1.min.js"
  integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4="
  crossorigin="anonymous"></script>

This is the jQuery CDN, and it's the fastest method of adding jquery to any site.

You can also download the jquery file from This link; And then upload this to the workspaces, then link it to your index.html file with a relative URL like so:

<script src="url-to-the-jquery-file.js"></script> 

I suggest adding the CDN link because it's the easiest way. Hope that helps. :sparkles:

Nafis Fuad