摘要: 首先来一张jQuery.Deferred的结构图:再来一张执行deferred.then(/*fnDone, fnFail, fnProcess*/)后的结构图:最后来看看源代码: 1 jQuery.extend({ 2 3 Deferred: function( func ) { 4 // 数据元组集 5 // 每个元组分别包含一些与当前deferred相关的信息: 6 // 分别是:触发回调函数列表执行(函数名),添加回调函数(函数名),回调函数列表(jQuery.Callbacks对象),deferred最终状态(第... 阅读全文
posted @ 2012-10-18 23:21 Lovesueee 阅读(3334) 评论(7) 推荐(1) 编辑
摘要: 来张jQuery结构图,方便大家整体了解: 阅读全文
posted @ 2012-10-18 17:36 Lovesueee 阅读(1584) 评论(6) 推荐(1) 编辑
摘要: 1 // String to Object options format cache 2 // 是对option的一个缓存,避免每次都要createOptions 3 // 每一个option类似这样 4 // { 5 // memory : true 6 // ,once : true 7 // ,... 8 // } 9 var optionsCache = {}; 10 11 // Convert String-formatted options into Object-formatted ones and store in cache 12... 阅读全文
posted @ 2012-10-18 17:24 Lovesueee 阅读(5186) 评论(3) 推荐(1) 编辑