Bug Tracker

Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#9005 closed bug (wontfix)

.live() breaks when using .add()

Reported by: jasmin@… Owned by:
Priority: undecided Milestone: 1.next
Component: unfiled Version: 1.5.2
Keywords: Cc:
Blocked by: Blocking:

Description

See example :

http://jsfiddle.net/fNeNX/

Change: .live("click",function......) to : .click(function....) and it works like a charm.

Tested with 1.5.2 and 1.4.2

Change History (2)

comment:1 Changed 9 years ago by ajpiano

Resolution: wontfix
Status: newclosed

Thanks for taking the time to help out the jQuery project, but this is a known limitation of .live(), as it is stated on the documentation

"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."

You may find that the delegate method is more appropriate for your use case.

comment:2 in reply to:  1 Changed 9 years ago by anonymous

Replying to ajpiano:

Thanks for taking the time to help out the jQuery project, but this is a known limitation of .live(), as it is stated on the documentation

"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."

You may find that the delegate method is more appropriate for your use case.

Hi,

Thank you for taking time to respond. I did not understand correctly that part of the documentation.

Note: See TracTickets for help on using tickets.