jQuery 1.0.4 New Wave Javascript(js源文件)

2020-05-19 07:32:46易采站长站整理

                    fn.apply( obj, [ clone ? a[i].cloneNode(true) : a[i] ] );
            }
        });
    },
    pushStack: function(a,args) {
        var fn = args && args[args.length-1];
        var fn2 = args && args[args.length-2];
        if ( fn && fn.constructor != Function ) fn = null;
        if ( fn2 && fn2.constructor != Function ) fn2 = null;
        if ( !fn ) {
            if ( !this.stack ) this.stack = [];
            this.stack.push( this.get() );
            this.set( a );
        } else {
            var old = this.get();
            this.set( a );
            if ( fn2 && a.length || !fn2 )
                this.each( fn2 || fn ).set( old );
            else
                this.set( old ).each( fn );
        }
        return this;
    }
};

jQuery.extend = jQuery.fn.extend = function() {
    // copy reference to target object
    var target = arguments[0],
        a = 1;
    // extend jQuery itself if only one argument is passed
    if ( arguments.length == 1 ) {
        target = this;