(转)JS托管和最新的jQuery引用地址大全(jQuery最新版v1.9.0)
什么是Google的js托管?
说的明白点,跟我们以往做法一样,只不过这时候的引用的js库是放在Google服务器上的。比如引用jquery,则使用路径http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.min.js即可。也就是无论是 谁的网站,只要使用了将得到与在自己服务器引用一样的效果。这当然有它的优点,要不然谁还大费周折搞什么托管。
Google托管的优势何在?
google有着遍布世界各地的DNS服务器,这便成了它可以做为托管的有利条件。比如我买了个国 外的域名空间,在北京访问的时候,通过DNS得到国外服务器上的资源,也许这个服务器很忙所以准备呆会再理我,也许这个服务器传输资源的路径很慢。但是通 过google的DNS服务器,可以为我分配一个最近而且不那么忙的服务器为我提供托管在它上面的js库,这样可以提高加载的速度。
Google托管的好处?
除了上面说的google拥有分布各地的DNS服务器,使用google托管还有一个好处就是有效地使用缓存。
回到第一个问题,我在访问了a.html之后又去访问一个名为b.html地文件,b.html引用了http://www.lanrensc.com/b/jquery.js,假设这两个 jquery版本是一样的,那么我在访问b.html,浏览器发现缓存里没有http:/www.lanrensc.com/b/jquery.js,于是重新加载js 库。
但如果这两个文件都使用的http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js,那么访问b.html时只要使用访问a.html时缓存在浏览器里的js库即可,好处显而易见了。
使用托管有不好的影响吗?
当然,任何好的东西都有不好的一面。正所谓托管,那对Google的依赖性一定是很强的了。一旦Google倒了(当然这应该是不可能的^_^)或者链接不上Google服务器,就可能无法加载jQuery,用到这个特效页面就会有问题,确实也是个大麻烦。
当然,这种情况我们可以通过条件判断,当引用google托管Jquery不成功时,则使用本地jQuery,本机服务器上再保存一个jQuery即可。
引用方法
<script type=text/javascript src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="http://www.lanrensc.com/statics/js/jquery.min.js">\x3C/script>')</script> //注释:引用google托管Jquery不成功时则使用本地Jquery。
常用Google jQuery版本引用地址:
1.2.6:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js" type="text/javascript"></script>
1.3.2:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script>
1.4.2:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
1.5.2:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js" type="text/javascript"></script>
1.6.2:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js" type="text/javascript"></script>
1.6.4:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js" type="text/javascript"></script>
1.7:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js" type="text/javascript"></script>
1.7.1:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
1.7.2:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script>
1.8:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js"></script>
1.8.2:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
1.8.3:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
1.9.0:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script> 来源于:http://www.lanrensc.com/All/SuCaiHeJi/123-Google-And-SAE-jQuery-JavaScript-Library-Address.shtml 谢谢分享
(转)JS托管和最新的jQuery引用地址大全(jQuery最新版v1.9.0)的更多相关文章
- 整理:Google jQuery 引用地址大全和方法(转)
什么是google的js托管? 说的明白点,跟我们以往做法一样,只不过这时候的引用的js库是放在google服务器上的. 比如引用jquery,则使用路径 http://ajax.googleapi ...
- jQuery 引用地址(包括jquery和google提供的地址), 节省你不必要的流量
转载自:http://www.cnblogs.com/henw/archive/2011/09/30/2196255.html 你可以使用这句代码读取jQuery的最新版本的代码文件. jquery官 ...
- jquery远程引用地址大全
jquery官方的引用地址,如图: <script typet="text/javascript" src="http://code.jquery.com/jque ...
- CSS以及JS各种库的在线CDN引用地址
JS类—— html5.js,让你的IE浏览器支持H5新特性:http://html5shiv.googlecode.com/svn/trunk/html5.js (记得要注释判断哦) JQuer ...
- jquery在线引用地址大全 全部来自官网
谷歌的就算了,容易被屏蔽,下面都是官方原版的 最新版本 <script src="http://code.jquery.com/jquery-latest.js">&l ...
- Jquery在线引用地址:
转自:http://www.cnblogs.com/lkf18/archive/2012/12/11/2813241.html 1. 很多网站都是使用这种方式引入,客户的浏览器可能已经缓存过了 jqu ...
- jQuery在线引用地址(全)
转:https://www.cnblogs.com/lmyau/p/7736269.html 1.官网jquery压缩版引用地址: 3.1.1版本: <script src="http ...
- 擦他丫的,今天在Django项目中引用静态文件jQuery.js 就是引入报错,终于找到原因了!
擦 ,今天在Django项目中引用静态文件jQuery.js 就是引入报错,终于找到原因了! 问题在于我使用的谷歌浏览器,默认使用了缓存,导致每次访问同一个url时,都返回的是缓存里面的东西.通过谷歌 ...
- jQuery验证控件jquery.validate.js使用说明
官网地址:http://bassistance.de/jquery-plugins/jquery-plugin-validation jQuery plugin: Validation 使用说明 转载 ...
随机推荐
- 面试题:实现LRUCache::Least Recently Used的缩写,意思是最近最少使用,它是一种Cache替换算法
Design and implement a data structure for Least Recently Used (LRU) cache. It should support the fol ...
- delphi xe5 android 手机上使用sqlite
本篇我们介绍一下在android手机上怎样使用sqlite数据库,这里用Navigator实现 增删改查. 1.新建firemonkey mobile application 2.选择blank ap ...
- Kaggle Competition Past Solutions
Kaggle Competition Past Solutions We learn more from code, and from great code. Not necessarily alwa ...
- 安装python环境(win7 64bit)
原地址:http://blog.csdn.net/bryanliu1982/article/details/7184814 虽然简单,但是过段时间又忘了,还是记下来比较好. 总体来说只有两步: 下载安 ...
- 为什么 API 监控对于任何业务来说都重要?
对于商务运算来说一个比较稳定的趋势在于对 API 日渐增长的依赖性,几乎每一个代码级交互过程都会调用 API 来收集数据或触发某些关键过程.没有 API ,你将无法与同伴进行文件交流,没有 API , ...
- 【网络流24题】 No.6 最长不减子序列问题 (最大流)[模型:最多不相交路径]
[题意] 给定正整数序列x1 ,x2 , x3... ( 1)计算其最长不减子序列的长度 s.( 2)计算从给定的序列中最多可取出多少个长度为 s 的不减子序列.( 3) 如果允许在取出的序列中多次使 ...
- spring初始化
* Created by litao on 15/12/29. */@Component("initTagDataProcessor")public class InitTagDa ...
- 【HDOJ】2209 翻纸牌游戏
状态压缩+双向广搜.注意控制时间t. /* 2209 */ #include <iostream> #include <string> #include <map> ...
- VM Depot 登陆中国!
发布于 2014-03-24 作者 陈 忠岳 今天我很高兴地向大家宣布,来自微软开放技术(上海)有限公司的首个产品 VM Depot 正式在中国发布!VM Depot是为Windows Azur ...
- 【转】调整mac电脑鼠标移动速度
原文网址:https://www.zhihu.com/question/19579075 作者:陆猛链接:https://www.zhihu.com/question/19579075/answer/ ...