包含两个不同调用的脚本的原因是什么? [英] What's the reason to include scripts with two different calls?

查看:80
本文介绍了包含两个不同调用的脚本的原因是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用HTML5样板,并在HTML页面中声明了两次jQuery,如下所示:

I use HTML5 boilerplate and jQuery is declared twice in the HTML page like this:

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/libs/jquery-1.6.2.min.js"><\/script>')</script>

这种方式包含JavaScript文件背后的原因是什么?

What's the reason behind including the JavaScript files this way?

似乎唯一的原因是如果无法从Google CDN访问jQuery库,那么从本地服务器加载jQuery库。

It seems to be the only reason is to load jQuery library from local server if it's not reachable from Google CDN.

推荐答案

他们认为html5 Boilerplate包含脚本的方式是因为它试图从本地服务器加载jQuery库,如果无法从Google CDN访问它。 =)

They reason html5 Boilerplate includes the script that way is because it attempts to "load jQuery library from local server if it's not reachable from Google CDN." =)

这篇关于包含两个不同调用的脚本的原因是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆