jQuery 1.0.4 - New Wave Javascript(js源文件)

2019-06-03 09:49:42刘景俊

        // Assume that it is an array of DOM Elements
        jQuery.merge( a, [] ) :

        // Find the matching elements and save them for later
        jQuery.find( a, c ) );

    // See if an extra function was provided
    var fn = arguments[ arguments.length - 1 ];

    // If so, execute it in context
    if ( fn && typeof fn == "function" )
        this.each(fn);

    return this;
};

// Map over the $ in case of overwrite
if ( typeof $ != "undefined" )
    jQuery._$ = $;

// Map the jQuery namespace to the '$' one
var $ = jQuery;



jQuery.fn = jQuery.prototype = {

    jquery: "1.0.4",


    size: function() {
        return this.length;
    },


    get: function( num ) {
        return num == undefined ?

            // Return a 'clean' array
            jQuery.merge( this, [] ) :

            // Return just the object
            this[num];
    },

    set: function( array ) {
        // Use a tricky hack to make the jQuery object
        // look and feel like an array
        this.length = 0;
        [].push.apply( this, array );
        return this;
    },

    each: function( fn, args ) {
        return jQuery.each( this, fn, args );