tags:

views:

17337

answers:

5

I use the following for a jquery link in my <script> tags:

http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.js

Just wondered if anyone had discovered whether there's a link to the "latest" version:

Something like the following (which doesn't work):

http://ajax.googleapis.com/ajax/libs/jquery/latest/jquery.js

(Obviously not necessarily a great plan to link your code to potentially changing libraries but useful in development)

+35  A: 

You can use:

http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js

To get the most recent version in the 1.x.x family or you could use:

http://ajax.googleapis.com/ajax/libs/jquery/1.2/jquery.min.js

To get the most recent version in the 1.2.x family.

EDIT:

In case anyone is interested Microsoft is also hosting jquery:

http://ajax.Microsoft.com/ajax/jQuery/jquery-1.3.2.js

EDIT 2:

jQuery is now hosting a version on their CDN:

http://code.jquery.com/jquery-1.4.2.min.js

Brian Fisher
Thanks Brian, that's just what I was after. I think your last edit isn't quite complete - if you get rid of the extra "or you could use" at the end I can accept your answer. Thanks again.
Nick Pierpoint
Glad it helped. Thanks for the correction, I fixed the answer.
Brian Fisher
The latest compressed version is available here: http://code.jquery.com/jquery-latest.min.js
toscho
+2  A: 

No. There isn't..

But, for development there is such a link on the jQuery code site.

nc
I'd seen that link, which led me to ask about an equivalent one on the "always available" Google link.
Nick Pierpoint
+7  A: 

Be aware that caching headers are different when you use "direct" vs. "latest" link from google.

When using http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.min.js

Cache-Control: public, max-age=31536000

When using http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js

Cache-Control: public, max-age=3600, must-revalidate, proxy-revalidate
Vilmantas Baranauskas
A: 

http://code.jquery.com/jquery-latest.min.js

this is the minified version, always up-to-date

Jacob
A: 

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.

Glenn Nelson