This commit is contained in:
Jörn Zaefferer 2007-01-17 13:24:44 +00:00
parent 53e12752e0
commit 3362ccf3dd
2 changed files with 2 additions and 2 deletions

View File

@ -34,7 +34,7 @@ test("get(Number)", function() {
test("add(String|Element|Array)", function() { test("add(String|Element|Array)", function() {
isSet( $("#sndp").add("#en").add("#sap").get(), q("sndp", "en", "sap"), "Check elements from document" ); isSet( $("#sndp").add("#en").add("#sap").get(), q("sndp", "en", "sap"), "Check elements from document" );
isSet( $("#sndp").add( $("#en")[0] ).add( $("#sap") ).get(), q("sndp", "en", "sap"), "Check elements from document" );
ok( $([]).add($("#form")[0].elements).length > 13, "Check elements from array" ); ok( $([]).add($("#form")[0].elements).length > 13, "Check elements from array" );
var x = $([]).add($("<p id='x1'>xxx</p>")).add($("<p id='x2'>xxx</p>")); var x = $([]).add($("<p id='x1'>xxx</p>")).add($("<p id='x2'>xxx</p>"));

View File

@ -985,7 +985,7 @@ jQuery.fn = jQuery.prototype = {
add: function(t) { add: function(t) {
return this.pushStack( jQuery.merge( return this.pushStack( jQuery.merge(
this.get(), this.get(),
typeof t == "string" ? jQuery(t).get() : t ) typeof t == "string" ? jQuery(t).get() : t.length ? t : [t] )
); );
}, },