正文内容加载中...
posted @ 2013-04-11 15:52 瓦尔登湖的秋天 阅读(97) 评论(0) 推荐(0) 编辑
正文内容加载中...
posted @ 2013-02-25 15:50 瓦尔登湖的秋天 阅读(75) 评论(0) 推荐(0) 编辑
摘要:1.传统模式validator = { validate: function (value, type) { switch (type) { case 'isNonEmpty ': { return true; // NonEmpty 验证结果 } case 'isNumber ': ... 阅读全文
posted @ 2013-02-25 13:52 瓦尔登湖的秋天 阅读(76) 评论(0) 推荐(0) 编辑
正文内容加载中...
posted @ 2013-02-22 11:30 瓦尔登湖的秋天 阅读(52) 评论(0) 推荐(0) 编辑
摘要:1.本体var Publication = new Interface('Publication', ['getIsbn', 'setIsbn', 'getTitle', 'setTitle', 'getAuthor', 'setAuthor', 'display']);var Book = function(isbn, title, author) { ... } // implements Publication/* Library interface. */va 阅读全文
posted @ 2013-02-22 11:04 瓦尔登湖的秋天 阅读(64) 评论(0) 推荐(0) 编辑
摘要:DED.util.Event = { getEvent: function(e) { return e || window.event; }, getTarget: function(e) { return e.target || e.srcElement; }, stopPropagation: function(e) { if (e.stopPropagation) { e.stopPropagation(); } else { e.cancelBubble = true; } }, preventDefault: f... 阅读全文
posted @ 2013-02-22 10:45 瓦尔登湖的秋天 阅读(69) 评论(0) 推荐(0) 编辑
正文内容加载中...
posted @ 2013-02-21 17:02 瓦尔登湖的秋天 阅读(63) 评论(0) 推荐(0) 编辑
摘要:1.简单工厂/* BicycleShop class. */var BicycleShop = function() {};BicycleShop.prototype = { sellBicycle: function(model) { var bicycle; switch(model) { case 'The Speedster': bicycle = new Speedster(); break; case 'The Lowrider': bicycle = new Lowrider(); ... 阅读全文
posted @ 2013-02-21 15:57 瓦尔登湖的秋天 阅读(67) 评论(0) 推荐(0) 编辑
摘要:1.var Singleton = (function () { var instantiated; function init() { /*这里定义单例代码*/ return { publicMethod: function () { console.log('hello world'); }, publicProperty: 'test' }; } return { getInstance: function () ... 阅读全文
posted @ 2013-02-21 14:33 瓦尔登湖的秋天 阅读(55) 评论(0) 推荐(0) 编辑
正文内容加载中...
posted @ 2012-11-21 10:22 瓦尔登湖的秋天 阅读(80) 评论(0) 推荐(0) 编辑