X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=src%2Fjquery%2Fjquery.js;h=b01038766ff64b58fe5d4bf1f372cb64cb55ffda;hb=2b82ffbbfac419e017acea3e0f83c063549e545e;hp=6d1fb2f99a2883e829f932789919104163d9707f;hpb=5b7f34d74bd78c97d86ae82f2899d0ce6d04b0c3;p=jquery.git diff --git a/src/jquery/jquery.js b/src/jquery/jquery.js index 6d1fb2f..b010387 100644 --- a/src/jquery/jquery.js +++ b/src/jquery/jquery.js @@ -33,7 +33,7 @@ var jQuery = function(a,c) { // HANDLE: $(function) // Shortcut for document ready // Safari reports typeof on DOM NodeLists as a function - if ( typeof a == "function" && !a.nodeType && a[0] == undefined ) + if ( jQuery.isFunction(a) && !a.nodeType && a[0] == undefined ) return new jQuery(document)[ jQuery.fn.ready ? "ready" : "load" ]( a ); // Handle HTML strings @@ -548,7 +548,7 @@ jQuery.fn = jQuery.prototype = { "textContent" : "innerText"; return e == undefined ? - jQuery.map(this, function(a){ return a[ type ]; }).join('') : + jQuery.map(this, function(a){ return a[ type ]; }).join("") : this.each(function(){ this[ type ] = e; }); }, @@ -864,7 +864,7 @@ jQuery.fn = jQuery.prototype = { */ filter: function(t) { return this.pushStack( - t.constructor == Function && + jQuery.isFunction( t ) && jQuery.grep(this, function(el, index){ return t.apply(el, [index]) }) || @@ -915,7 +915,7 @@ jQuery.fn = jQuery.prototype = { * * @name not * @type jQuery - * @param Array|jQuery elems A set of elements to remove from the jQuery set of matched elements. + * @param jQuery elems A set of elements to remove from the jQuery set of matched elements. * @cat DOM/Traversing */ not: function(t) { @@ -932,11 +932,11 @@ jQuery.fn = jQuery.prototype = { }, /** - * Adds the elements matched by the expression to the jQuery object. This - * can be used to concatenate the result sets of two expressions. + * Adds more elements, matched by the given expression, + * to the set of matched elements. * * @example $("p").add("span") - * @before

Hello

Hello Again

+ * @before

Hello

Hello Again * @result [

Hello

, Hello Again ] * * @name add @@ -946,7 +946,8 @@ jQuery.fn = jQuery.prototype = { */ /** - * Adds the on the fly created elements to the jQuery object. + * Adds more elements, created on the fly, to the set of + * matched elements. * * @example $("p").add("Again") * @before

Hello

@@ -961,15 +962,13 @@ jQuery.fn = jQuery.prototype = { /** * Adds one or more Elements to the set of matched elements. * - * This is used to add a set of Elements to a jQuery object. - * * @example $("p").add( document.getElementById("a") ) * @before

Hello

Hello Again

* @result [

Hello

, Hello Again ] * - * @example $("p").add([document.getElementById("a"), document.getElementById("b")]) - * @before

Hello

Hello AgainAnd Again

- * @result [

Hello

, Hello Again, And Again ] + * @example $("p").add( document.forms[0].elements ) + * @before

Hello