01 June 2012
The Latest Hosted jQuery
Given the most recent version of jQuery http://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)
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.
HTTPS vs HTTP
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"> </script>
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
http://bit.ly/jqsource. Here’s how to pull it down locally via the commandline:
wget http://bit.ly/jqsource -O jquery.js
curl http://bit.ly/jqsource > jquery.js
Now you only need to remember