简体   繁体   English

链接到最新版本的 jQuery

[英]Linking to latest version of jQuery

I expect these two links to point to the latest version of jQuery, version 1.11.0.我希望这两个链接指向最新版本的 jQuery,版本 1.11.0。

The code.jquery.com link points to 1.10.2 and the Google one points to 1.9.1. code.jquery.com 链接指向 1.10.2,Google 链接指向 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.我曾尝试清除浏览器缓存,甚至尝试过其他机器上的链接。

Use this for latest version from google ( although I personally don't recommend you to use latest version ):将此用于 google 的最新版本(尽管我个人不建议您使用最新版本):

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

Why does it point to 1.9.1?为什么它指向 1.9.1?

The latest version of jQuery may not be compatible with the existing plugins/code on the site.最新版本的 jQuery 可能与网站上现有的插件/代码不兼容。 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.与特定版本的 max-age=31536000 相比,最新版本的 max-age=3600 非常短,这意味着您将无法获得长期缓存的好处。

Source 来源

So, Google doesn't waste its resources unnecessarily.因此,Google 不会不必要地浪费其资源。 You'll need to manually upgrade the URL to the latest.您需要手动将 URL 升级到最新版本。

Not a good idea to use latest version of jQuery.使用最新版本的 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>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM