有条件地加载jQuery
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了有条件地加载jQuery相关的知识,希望对你有一定的参考价值。
if window.jQuery is undefined, there must have been a problem downloading the script from the CDN. In that case, proceed to the right side of the && operator, and insert a script linking to a local version of jQuery.
<!-- Grab Google CDN jQuery. fall back to local if necessary --> <script>!window.jQuery && document.write('<script src="js/jquery-1.4.2.min.js"></script>')</script>
以上是关于有条件地加载jQuery的主要内容,如果未能解决你的问题,请参考以下文章