<script src="https://www.jb51.net/article/LAB.js"></script> <script type="text/javaScript"> $LAB .script("script1.js").wait() .script("script2-a.js") .script("script2-b.js") .wait(function(){ initScript1(); initScript2(); }) .script("script3.js") .wait(function(){ initScript3(); }); </script>
方式五:requireJS
<script src="https://www.jb51.net/require.js"></script> <script type="text/javaScript"> require([ "script1.js", "script2-a.js", "script2-b.js", "script3.js" ], function(){ initScript1(); initScript2(); initScript3(); } ); </script>