这几天在看seaJs 前端js发展到今天 确实是需要模块化管理了 在大型项目中 维护优化非常的重要 提高运行速度
简单的用了下 还是很不错的
//定义模块 test2.js
define(function(require,exports,module){
exports.sayHello = function(){
alert('HelloWorld');
};
})
//调用模块 test1.js
seajs.use('test2',function(a){
a.sayHello();
})
最基本的就是这样
参考 seajs.com