4.6 学习记录

替代方案

如果您不希望下载并存放 jQuery,那么也可以通过 CDN(内容分发网络) 引用它。

Staticfile CDN、百度、又拍云、新浪、谷歌和微软的服务器都存有 jQuery 。

如果你的站点用户是国内的,建议使用百度、又拍云、新浪等国内CDN地址,如果你站点用户是国外的可以使用谷歌和微软。

注:本站实例均采用菜鸟教程 CDN 库。

如需从 Staticfile CDN、又拍云、新浪、谷歌或微软引用 jQuery,请使用以下代码之一:

Staticfile CDN:

<head> <script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"> </script> </head>

尝试一下 »

百度 CDN:

<head> <script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"> </script> </head>

尝试一下 »

又拍云 CDN:

<head> <script src="https://upcdn.b0.upaiyun.com/libs/jquery/jquery-2.0.2.min.js"> </script> </head>

尝试一下 »

新浪 CDN:

<head> <script src="https://lib.sinaapp.com/js/jquery/2.0.2/jquery-2.0.2.min.js"> </script> </head>

尝试一下 »

Google CDN:

<head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"> </script> </head>

尝试一下 »
lamp 不大推荐使用Google CDN来获取版本,因为Google产品在中国很不稳定。

Microsoft CDN:

<head> <script src="https://ajax.aspnetcdn.com/ajax/jquery/jquery-1.9.0.min.js"></script> </head>
原文地址:https://www.cnblogs.com/blog-wangke/p/14852385.html