Active1 month ago
This question already has an answer here:
- Latest jQuery version on Google's CDN 5 answers
I use the following for a jQuery link in my
<script>
tags:Search the world's information, including webpages, images, videos and more. Google has many special features to help you find exactly what you're looking for.
Is there a link to the 'latest' version? Something like the following (which doesn't work):
(Obviously not necessarily a great plan to link your code to potentially changing libraries but useful in development.)
John Slegers30.6k1313 gold badges161161 silver badges137137 bronze badges
Nick PierpointNick Pierpoint11.2k88 gold badges3939 silver badges7474 bronze badges
marked as duplicate by Blazemonger jqueryJan 30 '15 at 18:11
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
12 Answers
Up until jQuery 1.11.1, you could use the following URLs to get the latest version of jQuery:
- https://code.jquery.com/jquery-latest.min.js - jQuery hosted (minified)
- https://code.jquery.com/jquery-latest.js - jQuery hosted (uncompressed)
- https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js - Google hosted (minified)
- https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js - Google hosted (uncompressed)
For example:
However, since jQuery 1.11.1, both jQuery and Google stopped updating these URL's; they will forever be fixed at 1.11.1. There is no supported alternative URL to use. For an explanation of why this is the case, see this blog post; Don't use jquery-latest.js.
Both hosts support
https
as well as http
, so change the protocol as you see fit (or use a protocol relative URI)See also: https://developers.google.com/speed/libraries/devguide
DO NOT USE THIS ANSWER. The URL is pointing at jQuery 1.11 (and always will).
Credits to Basic for above snippet
http://code.jquery.com/jquery-latest.min.js is the minified version, always up-to-date.
Peter Mortensen14.4k1919 gold badges8888 silver badges117117 bronze badges
JacobJacob
Be aware that caching headers are different when you use 'direct' vs. 'latest' link from google.
![Google ajax library catalog Google ajax library catalog](/uploads/1/2/5/7/125792485/597723626.jpg)
When using http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.min.js
When using http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js
Vilmantas BaranauskasVilmantas Baranauskas4,84311 gold badge2626 silver badges4141 bronze badges
Don’t Use jquery-latest.js
This file is no longer updated (it'll be on v1.11.1 forever). Furthermore it has a very short cache life, (wiping out the benefits of using a CDN) so you'd be better of selecting a version of jQuery instead.
More details on the jQuery blog:http://blog.jquery.com/2014/07/03/dont-use-jquery-latest-js/
coliffcoliff
Not for nothing, but you shouldn't just automatically use the latest library. If they release the newest library tomorrow and it breaks some of your scripts, you are SOL, but if you use the library you used to develop the scripts, you will ensure they will work.
Peter Mortensen14.4k1919 gold badges8888 silver badges117117 bronze badges
user372743
Use:
Note: The above snippet will stick to 1.7.1 or 1.11.1.
My advice for production is to hard code the CDN jQuery version:
<script src='//ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js'></script>
You can find the latest Libraries of Google CDN here:https://developers.google.com/speed/libraries/
Or use the jQuery CDN:https://code.jquery.com/
Peter Mortensen14.4k1919 gold badges8888 silver badges117117 bronze badges
PlippiePlippie
jQuery also doesn't allow you to call their latest file over SSL, a consideration if you want to use jQuery in a shopping cart etc.
e.g.
will give you a security error.
Google's API will let you call over SSL:
Matt64.6k1818 gold badges123123 silver badges166166 bronze badges
YaritoYarito
Yes there is.
Brant Bobby9,9391313 gold badges7272 silver badges113113 bronze badges
RomaRoma
No. There isn't..
But, for development there is such a link on the jQuery code site.
nc.nc.3,66944 gold badges2323 silver badges3434 bronze badges
What about this one?
I think this is always the latest version - Correct me, if I'm wrong.
Søren Larsen PedersenSøren Larsen Pedersen
http://lab.abhinayrathore.com/jquery_cdn/ is a page where you can find links to the latest versions of jQuery, jQuery UI and Themes for Google and Microsoft CDN's.
This page automatically updates with the latest links from the CDN.
Peter Mortensen14.4k1919 gold badges8888 silver badges117117 bronze badges
AbhinayAbhinay
You can use the latest version of the jQuery library by any of the following.
- Google Ajax API CDN (also supports SSL via HTTPS)/jquery.min.js
- Microsoft CDN (also aupports SSL via HTTPS)Ajax CDN Announcement, Microsoft Ajax CDN Documentation
- jQuery CDN (via Media Temple)** Minified version** Development (Full) version
14.4k1919 gold badges8888 silver badges117117 bronze badges
arunarun