一个小小的加载器的雏形

<!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>

  

posted @ 2014-09-29 11:05  郑俊伟  阅读(105)  评论(0编辑  收藏  举报