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 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