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 trialMohammed Jammeh
37,463 PointsConfused about the jQuery CDN Download
In the 'Ways to Include jQuery' video, Andrew suggests going to https://jquery.com/download/ to download the jQuery file by including the link at the bottom of a HTML file.
However, I am quite confused. It seems like this page or download source has been updated and there are many other links. Which links do you recommend is the most suitable at the moment?
3 Answers
Rich Donnellan
Treehouse Moderator 27,696 PointsHey Mohammed,
I'll recommend something different. Rather than download any files and host them yourself, you can use a CDN to do the heavy lifting for you. All you need to do is include a specific <script>
tag in your HTML.
Go to http://code.jquery.com/ and select the version of jQuery that best suits your needs. It will most likely be the latest minified version (which doesn't support <IE9). You'll then copy the presented code snippet and paste that above any scripts that require the library. Here is the current snippet:
<script src="http://code.jquery.com/jquery-3.0.0.min.js" integrity="sha256-JmvOoLtYsmqlsWxa7mDSLMwa6dZ9rrIdtrrVYRnDRH0=" crossorigin="anonymous"></script>
Uncompressed: Developer friendly code that is nicely formatted and includes comments
Minified: Production ready with all formatting/white-space/comments stripped
Mohammed Jammeh
37,463 PointsOh okay, I understand now. It's working as well. Thanks so much guys, appreciate it :)
Anas AlHariri
8,776 PointsI'm using this. Is it ok?
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
Mars Epaecap
5,110 PointsMars Epaecap
5,110 PointsI'm on the same page as you, I went to https://code.jquery.com/ and picked minified version of what seemed to be the latest (jQuery 3.x at the time of writing this) which has
the code in my Index.html file now looks like this: