-5

I expect these two links to point to the latest version of jQuery, version 1.11.0.

The code.jquery.com link points to 1.10.2 and the Google one points to 1.9.1.

Can anyone explain why, or indicate something which I might be doing wrong? I have tried clearing my browser cache and even tried the links on other machines.

Jamie Holdstock
  • 166
  • 1
  • 11
  • jQuery's API has sometimes changed in a way that is not backwards compatible. Connecting to the latest, rather than a specific version could break your pages. –  Mar 26 '14 at 16:48
  • I wouldn't recommend linking to the latest version of jQuery unless you plan to be consistently checking to make sure that nothing has been deprecated and that your code is up to date. – robbclarke Mar 26 '14 at 16:49
  • I like this answer http://stackoverflow.com/questions/12608242/latest-jquery-version-on-googles-cdn – j08691 Mar 26 '14 at 16:49
  • 2
    Why? Because each site has its own politic regarding which version is the lastest stable one. Or maybe because of some dudes lazyness... ;) – A. Wolff Mar 26 '14 at 16:50
  • Yes, I agree with the above comments. Use a specific version. – Farhan Khan Mar 26 '14 at 16:50

2 Answers2

2

Use this for latest version from google (although I personally don't recommend you to use latest version):

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

Why does it point to 1.9.1?

The latest version of jQuery may not be compatible with the existing plugins/code on the site. Version updating should be an intentional decision. The latest version has a very short max-age=3600 compares to the specific version of max-age=31536000, which means you won't get the benefits of long-term caching.

Source

So, Google doesn't waste its resources unnecessarily. You'll need to manually upgrade the URL to the latest.

Amit Joki
  • 58,320
  • 7
  • 77
  • 95
1

Not a good idea to use latest version of jQuery.

But if you really want that specific version, it's at:

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
Farhan Khan
  • 590
  • 5
  • 6