Skip to main content

Bug Tracker

Side navigation

#837 closed bug (fixed)

Opened January 17, 2007 03:25PM UTC

Closed January 20, 2007 04:16AM UTC

Last modified June 19, 2007 09:24AM UTC

DOM inconsistency in add(),maybe more places

Reported by: Owned by:
Priority: major Milestone: 1.1
Component: core Version: 1.1
Keywords: Cc:
Blocked by: Blocking:

1.0.4 version has support for direct manipulation on DOM elements,something like:


where "el" is simply DOM element,now in 1.1 I need to wrap it to $(),as:

$("li.hl",p).add( $(el) ).each()

otherwise construction dosen't work at all.

Attachments (0)
Change History (2)

Changed January 17, 2007 03:48PM UTC by sa.cesare@gm comment:1

OK,I found bug,1.04:

add: function(t) {

return this.pushStack( jQuery.merge( this,

typeof t == "string" ? jQuery.find(t) : t.constructor == Array ? t : [t] ), arguments );


in 1.1 reduced to:



typeof t == "string" ? jQuery(t).get() : t


so,it always assume "t" is "Array",that contradictonary to docs,which promote array/element/sequence(of elements) interchangeability.

IMHO,it must exists generic conversion "toArray" method,used across framework everywhere,if you will,but it seems every method has it's own parameter parsing logic.

Changed January 20, 2007 04:16AM UTC by john comment:2

resolution: → fixed
status: newclosed

Fixed in SVN rev 1137.