使用下面的代码行,就像大多数网站一样,我想知道,是否可以为此提供备份替代方案?例如,如果 googleapis.com~ 已关闭,是否使用其他 script src
代替?
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
提前致谢
安德斯
最佳答案
尝试这样的事情:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"></script>
<script>if(typeof jQuery=="undefined"){document.write(unescape("%3Cscript src='/Scripts/jquery-1.4.3.min.js' type='text/javascript'%3E%3C/script%3E"));}</script>
关于javascript - JQuery 备份替代方案,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4516751/