代码如下:
<\/script>
<\/script>
2.动态写入页面
代码如下:
document.write('<\/script>')
document.write('<\/script>')
3.模拟包含函数
代码如下:
function include(path){
var a=document.createElement("script");
a.type = "text/javascript";
a.src=path;
var head=document.getElementsByTagName("head")[0];
head.appendChild(a);
}
include("a.js")
include("b.js")
4.js模块化编程
require.js的方法
Copyright © 2019- huatuo9.cn 版权所有 赣ICP备2023008801号-1
违法及侵权请联系:TEL:199 18 7713 E-MAIL:2724546146@qq.com
本站由北京市万商天勤律师事务所王兴未律师提供法律服务