js文件包含的几种方式介绍
1.页面中直接引用
<scriptsrc="a.js"><\/script> <scriptsrc="b.js"><\/script>
2.动态写入页面
document.write('<scriptsrc="a.js"><\/script>')
document.write('<scriptsrc="b.js"><\/script>')
3.模拟包含函数
functioninclude(path){
vara=document.createElement("script");
a.type="text/javascript";
a.src=path;
varhead=document.getElementsByTagName("head")[0];
head.appendChild(a);
}
include("a.js")
include("b.js")
4.js模块化编程
require.js的方法
热门推荐
10 感谢韩语老师祝福语简短
11 升职文案高级祝福语简短
12 花童结婚祝福语大全简短
13 向国庆送祝福语简短
14 什么寄语简短祝福语女生
15 客户回礼祝福语大全简短
16 女孩生日祝福语简短创意
17 家长回复节日祝福语简短
18 给外婆敬酒祝福语简短