几个常用脚本资源的库cdn

jquery,extjs,bootstrap等成熟的框架库,让我们的开发更加容易,但是这些库本身动则上百K,有时要加载好几个文件,为了减轻服务器负担,减少前端响应时间,我们可以通过几家知名网站提供的CDN。

Bootstrap官方CDN

提供的CDN资源有:
Complete CSS (Responsive, With Icons)

Complete JavaScript


Optional:
Complete Bootstrap CSS (Without Icons)

微软公共资源CDN

微软为了方面其开发者使用,也开通了丰富的公共库的CDN。地址为:http://www.asp.net/ajaxlibrary/CDN.ashx


主要的资源有:

ajax.microsoft.com renamed to ajax.aspnetcdn.com 
Visual Studio .vsdoc Support 
Using ASP.NET Ajax from the CDN 
Using jQuery from the CDN 
Using jQuery UI from the CDN 
Third-Party Files on the CDN 
    jQuery Releases on the CDN 
    jQuery Migrate Releases on the CDN 
    jQuery UI Releases on the CDN 
    jQuery Validation Releases on the CDN 
    jQuery Mobile Releases on the CDN 
    jQuery Templates Releases on the CDN 
    jQuery Cycle Releases on the CDN 
    jQuery DataTables Releases on the CDN 
    Modernizr Releases on the CDN 
    Ajax Control Toolkit Releases on the CDN 
    JSHint Releases on the CDN 
    Knockout Releases on the CDN 
    Globalize Releases on the CDN 
    ASP.NET Web Forms and Ajax Releases on the CDN 
    ASP.NET MVC Releases on the CDN 
    ASP.NET SignalR Releases on the CDN 

百度CDN公共库

CDN公共库是指将常用的JS库存放在CDN节点,以方便广大开发者直接调用。与将JS库存放在服务器单机上相比,CDN公共库更加稳定、高速。 百度公共CDN为您的应用程序提供稳定、可靠、高速的服务,包含全球所有最流行的开源JavaScript库。地址:http://developer.baidu.com/wiki/index.php?title=docs/cplat/libs

CDN资源有:


新浪公共资源CDN

公共资源包含Jquery、 Mootools、 Prototype、YUI等通用JS/CSS Framework;您可以通过地址直接引用。公共资源前端采用CDN技术,节点分布在全国各地;用户可以就近取得资源内容, 提升您的应用速度。

详细资源请访问:http://sae.sina.com.cn/?m=devcenter&catId=147



其它

类似jquery这种开源代码均可在code.google.com或gitHub上找到相关CDN链接

如jquery在code.google.com上的连接是://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js

使用方法

以下是别人写的使用新浪cdn加速库的方法,仅供参考:

<script src="//http://lib.sinaapp.com/js/jquery/1.7.2/jquery.min.js"></script>
<script>
if (!window.jQuery) {
    var script = document.createElement('script');
    script.src = "/js/jquery.min.js";
    document.body.appendChild(script);
}
</script>


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值