Bug Tracker

Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#9561 closed bug (invalid)

Bug with multiple class selector

Reported by: [email protected] Owned by:
Priority: undecided Milestone: 1.next
Component: unfiled Version: 1.6.1
Keywords: Cc:
Blocked by: Blocking:


I don't know if you had already been aware of this issue:

if you are using live to add eventHandlers, the live function relies on the selector property of JQ object. but the thing is when you are using something like $("div.class1, div.class2").find("a").live, the selector would be incorrect as "div.class1, div.class2 a" which is not as expected.

$("div.class1").find("a").selector = "div.class1 a";

$("div.class1, div.class2").find("a").selector = "div.class1, div.class2 a";

I'm not sure if it is by design or you will fix it.

anyway, jQuery is cool and thx for your efforts!

thx, Kail

Change History (4)

comment:1 Changed 12 years ago by dmethvin

Resolution: invalid
Status: newclosed

As the .live() docs indicate, that isn't valid usage.

comment:2 Changed 12 years ago by anonymous

??? That DOES sound like a bug to me and not "invalid usage". All the docs say is that attaches "a handler to the event for all elements which match the current selector, now and in the future."

And if the current selector is built incorrectly (as it obviously is) this behavior is unexpected.

comment:3 Changed 12 years ago by ajpiano

.live() is not meant to work against anything other than a direct selector, which is why $("foo").find("bar").live() will is always considered to be an invalid usage. From the docs:

"DOM traversal methods are not supported for finding elements to send to .live(). Rather, the .live() method should always be called directly after a selector, as in the example above."

comment:4 Changed 12 years ago by anonymous

ok, if the only case that the selector property would be used is in the .live() func, it should be fine to ignore this issue. But what if there's anything else other than .live() that has dependency on the selector property, don't you consider it as valid?

Note: See TracTickets for help on using tickets.