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 周六早晨祝福语简短