为了提高页面速度我使用谷歌CDN下载jquery文件,我也回退到从本地下载jquery谷歌CDN失败.
以下是使用后备的方法
<script type="text/javascript" src="http://ajax.microsoft.com/ajax/jquery/jquery-1.9.1.min.js"></script>
<script type="text/javascript">
if (typeof jQuery == 'undefined') {
document.write(unescape("%3Cscript src='common/script/jquery-1.9.1.min.js' type='text/javascript'%3E%3C/script%3E"));
}
</script>
Run Code Online (Sandbox Code Playgroud)
上面的代码是完美的,我的问题是如何检查是否加载了jquery迁移文件?
我只需要检查是否加载了http://code.jquery.com/jquery-migrate-1.1.0.js.我希望if(typeof jQuery =='undefined'){}这不会在这里工作.
任何解决方案