1. 页面中直接引用
<script src="a.js"><\/script> <script src="b.js"><\/script>
document.write('<script src="a.js"><\/script>') document.write('<script src="b.js"><\/script>')
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")
require.js的方法