首页 > 技术文章 > 一个小小的加载器的雏形

qianduanlover 2014-09-29 11:05 原文

<!doctype html>
<html>
  <head></head>
  <body>
    <script>
      function createScript(str,callFunc,callArgument){
        var myScript = document.createElement("script");
        myScript.src = str;
        document.body.appendChild(myScript);
 	if(typeof callArgument === "string" && typeof callFunc === "function"){callFunc(callArgument)}
      }
      createScript('a.js',createScript,'c.js');
      //createScript('c.js');
          </script>
  </body>
</html>

  

推荐阅读