摘要: jQuery.extend({ Deferred: function(func) { // 数据集中管理 var tuples = [ ['resolve', 'done', jQuery.Callbacks('once memory'), 'resolved'], ['reject', 'fail', jQuery.Callbacks('once memory'), 'rejected'], ['notify', 'progress' 阅读全文
posted @ 2013-05-14 21:37 LukeLin 阅读(994) 评论(0) 推荐(0) 编辑
摘要: 职责链模式 阅读全文
posted @ 2013-05-14 11:10 LukeLin 阅读(960) 评论(0) 推荐(0) 编辑
摘要: 1 var optionsCache = {}; 2 3 /* 4 根据字符串格式的参数创建对象的键值对象, 5 并且返回一个object变量存储已经存在的key参数,且value值为true, 6 与optionsCache引用同一个对象 7 */ 8 9 function createOptions(options) { 10 var object = optionsCache[options] = {}; 11 jQuery.each(options.match(core_rn... 阅读全文
posted @ 2013-05-13 16:42 LukeLin 阅读(925) 评论(0) 推荐(0) 编辑
摘要: 1 2 3 4 命令模式 5 6 7 8 9 1303 1304 阅读全文
posted @ 2013-05-13 15:43 LukeLin 阅读(795) 评论(0) 推荐(0) 编辑
摘要: 1 2 3 4 观察者模式 5 6 7 8 23 879 880 887 894 901 902 1016 1017 阅读全文
posted @ 2013-05-13 15:42 LukeLin 阅读(1392) 评论(0) 推荐(0) 编辑
摘要: 代理模式 阅读全文
posted @ 2013-05-13 15:41 LukeLin 阅读(861) 评论(0) 推荐(0) 编辑
摘要: <!DOCTYPE html><html><head> <title>Web 日历</title> <meta charset="utf-8"> <script src="interface.js"></script> <script src="MethodProfiler.js"></script> <style> .month { overflow: hidden; zoom: 1; } .day { 阅读全文
posted @ 2013-03-24 14:09 LukeLin 阅读(334) 评论(0) 推荐(0) 编辑
摘要: <!DOCTYPE html><html><head><title>工具提示(享元模式)</title><meta charset="utf-8"><script src="Library.js"></script></head><body><a id="link-id1" href="">1111111</a><a id="link-id2" h 阅读全文
posted @ 2013-03-24 14:05 LukeLin 阅读(228) 评论(0) 推荐(0) 编辑
摘要: 1 2 3 4 享元模式(flyweight) 5 6 7 8 9 10 11 12 13 1116 1117 阅读全文
posted @ 2013-03-24 14:04 LukeLin 阅读(793) 评论(0) 推荐(0) 编辑
摘要: <!DOCTYPE html><html><head> <title>方法性能分析器</title> <meta charset="utf-8"></head><body><div id="list-container"></div> <script> function $(id){ return document.getElementById(id); }</script><script> // L 阅读全文
posted @ 2013-03-24 14:03 LukeLin 阅读(248) 评论(0) 推荐(0) 编辑