来自CDN的jQuery [英] jquery from cdn
问题描述
我如何在CDN中加载以下内容,如果它们失败,我将打包本地文件以加载失败
How do i load the following in cdn and if they fail i would wnat my local file to load if this fails
- Google的CDN :jquery.min.js和jquery-ui.min.js.
- Microsoft的CDN: jQuery.Validate.min.js
- Google's CDN : jquery.min.js and jquery-ui.min.js.
- Microsoft's CDN : jQuery.Validate.min.js
推荐答案
jORQUE
<script type="text/javascript" src="http://ajax.microsoft.com/ajax/jquery/jquery-1.3.2.min.js"></script>
<script type="text/javascript">
if (typeof jQuery == 'undefined')
{
document.write(unescape("%3Cscript src='/scripts/jquery-1.3.2.min.js' type='text/javascript'%3E%3C/script%3E")); //local
}
</script>
对于Jquery Ui
For Jquery Ui
if (jQuery.ui) {
document.write(unescape("%3Cscript src='/scripts/jqueryui-1.8.2.min.js' type='text/javascript'%3E%3C/script%3E")); //local
}
对于Jquery验证
if(!jQuery().validate) {
document.write(unescape("%3Cscript src='/scripts/jquery.validate.min.js' type='text/javascript'%3E%3C/script%3E")); //local
}
链接 MS validate.js- http://ajax.microsoft. com/ajax/jQuery.Validate/1.6/jQuery.Validate.min.js
Links MS validate.js - http://ajax.microsoft.com/ajax/jQuery.Validate/1.6/jQuery.Validate.min.js
Google jquery.min.js- http://ajax.googleapis.com/ajax/libs/jquery/1.4.0/jquery.min.js
Google jquery.min.js - http://ajax.googleapis.com/ajax/libs/jquery/1.4.0/jquery.min.js
Google jquery.ui.js- http ://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js
Google jquery.ui.js - http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js
Google JqueryUi主题-(将基本主题名称更改为一个)
Google JqueryUi theme- (change base to one of the core theme name) http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.9/themes/base/jquery-ui.css
这篇关于来自CDN的jQuery的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!