JS异步加载AMD和CMD

 

CommonJS 是个规范,主要用于js后端,
var foo = require("./foo");
foo("Hi");


AMD前置加载 require.js
require(['math'], function (math) {

    math.add(2, 3);

 });

 

CMD后置加载 sea.js
define(function(require,exports,module){
var a = require('./a');
a.doSomthing();
});

参考文件 https://www.cnblogs.com/chenguangliang/p/5856701.html

相关文章:

  • 2022-02-07
  • 2022-12-23
  • 2022-12-23
  • 2022-02-07
  • 2022-02-07
  • 2022-12-23
  • 2021-09-13
猜你喜欢
  • 2022-02-07
  • 2022-02-07
  • 2021-10-11
  • 2021-12-11
相关资源
相似解决方案