摘要:
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 阅读全文
摘要:
第一次看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" 阅读全文