首页 > 我的文章 > PHP开发 > javascript的代码 > 动态加载JS文件

动态加载JS文件

浏览:1179 编辑:绿萝 来源:绿萝
动态加载JS文件
    _TBFD.script = document.createElement("script");
    _TBFD.script.type = "text/javascript";
    _TBFD.script.async = true;
    _TBFD.script.charset = "utf-8";
    _TBFD.script.src = (('https:' == document.location.protocol?'https://ssl-static1':'http://static1')+'.bfdcdn.com/service/xxxxx.js');
    document.getElementsByTagName("head")[0].appendChild(_TBFD.script);