动态加载jquery

来源:互联网 发布:淘宝追加好评在哪看 编辑:程序博客网 时间:2024/05/22 10:44
  如果要在js中动态加载jquery的话,可以这样:
function checkJquery() {if(!(window.jQuery)) {var s = document.createElement('script');s.setAttribute('src', 'http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js');s.setAttribute('type', 'text/javascript');document.getElementsByTagName('head')[0].appendChild(s);}}
原创粉丝点击