动态加载js

动态加载js

varelement=document.createElement('script');

element.id="script1";

element.setAttribute("type","text/javascript");

element.setAttribute("charset","utf-8");

element.setAttribute("src","a.js");

element.setAttribute('src',"http://abc.def.com/abc");

document.body.appendChild(element);

相关推荐