2011年8月30日
摘要: jQuery.extend = jQuery.fn.extend = function() { var options, name, src, copy, copyIsArray, clone, target = arguments[0] || {}, i = 1, length = arguments.length, deep = false; if ( typeof target === "boolean" ) {//深度复制 deep = target; target = arguments[1] || {}; i = 2; } if ( typeof target 阅读全文
posted @ 2011-08-30 17:32 不知道用什么名字 阅读(1164) 评论(0) 推荐(0) 编辑
摘要: 第一次看jQuery的源代码,转得好晕,苦逼的isPlainObject, 判断是否为纯粹的对象isPlainObject: function( obj ) { if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {//为空,节点,window对象,非object返回false; return false; } if ( obj.constructor && !hasOwn.call(obj, "constructor" 阅读全文
posted @ 2011-08-30 16:26 不知道用什么名字 阅读(929) 评论(2) 推荐(1) 编辑