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

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

    },


    add: function(t) {
        return this.pushStack( jQuery.merge( this, typeof t == "string" ?
            jQuery.find(t) : t.constructor == Array ? t : [t] ), arguments );
    },

    is: function(expr) {
        return expr ? jQuery.filter(expr,this).r.length > 0 : false;
    },

    domManip: function(args, table, dir, fn){
        var clone = this.size() > 1;
        var a = jQuery.clean(args);

        return this.each(function(){
            var obj = this;

            if ( table && this.nodeName.toUpperCase() == "TABLE" && a[0].nodeName.toUpperCase() != "THEAD" ) {
                var tbody = this.getElementsByTagName("tbody");

                if ( !tbody.length ) {
                    obj = document.createElement("tbody");
                    this.appendChild( obj );
                } else
                    obj = tbody[0];
            }

            for ( var i = ( dir < 0 ? a.length - 1 : 0 );
                i != ( dir < 0 ? dir : a.length ); i += dir ) {
                    fn.apply( obj, [ clone ? a[i].cloneNode(true) : a[i] ] );