`

在js里引用另一个js文件

阅读更多
 new_element=document.createElement("script");
 new_element.setAttribute("type","text/javascript");
new_element.setAttribute("src","a.js");// 在这里引入了a.js
 document.body.appendChild(new_element);
 
 function b()  {
     a();
 }
或使用jquery的$.getScript("a.js",function(){});  IE6下不管用
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics