seaJs

这几天在看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

posted @ 2011-12-27 15:34  Nano  阅读(483)  评论(2编辑  收藏  举报