摘要: 拥抱模块化的JavaScripthttp://www.cnblogs.com/snandy/archive/2012/03/07/2378432.html 阅读全文
posted @ 2012-09-17 19:14 microsoftzhcn 阅读(242) 评论(0) 推荐(0) 编辑
摘要: 目录 模块定义 define id dependencies factory exports require require.async require.resolve require.load require.constructor module module.id module.dependencies module.exports module.constructor seajs.config aliasjquery.js与sea.js综合使用简介:SeaJS:javascrīpt模块化开发jQuery:javas... 阅读全文
posted @ 2012-09-17 16:58 microsoftzhcn 阅读(10997) 评论(1) 推荐(0) 编辑
摘要: 理论上可以直接升级,除非有用到以下特性:data-main 的路径解析规则发生变化,从 1.2.0 开始调整为与 seajs.use 保持一致,即 data-main="init" 等价 seajs.use("init"). 因此使用 1.1.0 的项目中如果有 data-main="xxx" 的,需要调整为 data-main="./xxx" 。请参考: #217noConflict 方法移除。如果需要用到,可以自己修改下 sea.js 源码,将命名空间改成自己的。去掉该方法,是因为该方法的使用频率极低。prel 阅读全文
posted @ 2012-09-17 15:19 microsoftzhcn 阅读(226) 评论(0) 推荐(0) 编辑
摘要: 使用SeaJS实现模块化JavaScript开发http://www.cnblogs.com/leoo2sk/archive/2011/06/27/write-javascript-with-seajs.html 阅读全文
posted @ 2012-09-17 13:39 microsoftzhcn 阅读(214) 评论(0) 推荐(0) 编辑
摘要: 1、定义模块<在JS中定义>define('./dom', [], function(require, exports, module) { var mod; return mod = { 'a' : function() { alert('a'); }, 'b' : function() { alert(... 阅读全文
posted @ 2012-09-17 13:33 microsoftzhcn 阅读(304) 评论(0) 推荐(0) 编辑