01 June 2012

The Latest Hosted jQuery

Given the most recent version of jQuery https://code.jquery.com/jquery-latest.min.js, you can find the latest hosted versions here…

Google CDN (SSL via HTTPS is optional)

Microsoft CDN (SSL via HTTPS is optional)

jQuery CDN

Why not just use the link that’s always the latest?

You shouldn’t use the jquery-latest link in your applications because the CDNs (content delivery networks) offer better caching on the versioned urls, and your application may have unpredictable results if something changes in a newer version of jQuery.


For the CDNs with optional https, you can just reference the script in your HTML files as shown below and it will choose the protocol that matches your site. Even if your site doesn’t use SSL, you’re cutting back on a few characters and ready to go if you eventually do support https.

<script src="//ajax.googleapis.com/ajax/libs/jquery/0.0.0/jquery.min.js">

This is safe to use cross-browser.

Is this up-to-date?

Yes, it programmatically gets the version number from the jquery-latest file. The only risk is that the CDN’s haven’t updated yet to include the latest version, but if you open the link and it’s there, then you’re safe.

Download it locally!

You might want to download the latest file locally—especially if you’re developing offline. The easiest url to remember for this is https://bit.ly/jqsource. Here’s how to pull it down locally via the commandline:

wget https://bit.ly/jqsource -O jquery.js


curl https://bit.ly/jqsource > jquery.js

Now you only need to remember mrcoles.com/jquery ;?j

Comments (1)

1. harold wrote:
<p> ;?j </p>

Posted on 1 June 2012 at 10:06 AM  |  permalink

Did you find this helpful or fun? Please donate!

donate via btc or eth

btc: 18jCzwsZDGQYcs6Kyv92pd4683cnnxm1Dd
eth: 0xC285F21Cb271Cb4B3F70c4C47B2f7B26063AF590
paypal: paypal.me/mrcoles

Peter Coles

Peter Coles

is a software engineer who lives in NYC, works at Ringly, and blogs here.
More about Peter »

github · soundcloud · @lethys · rss

It’s time to get big money out of politics. Join the kick-started campaign to put government back in the hands of the people. Pledge mayday.us now