Bug Tracker

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#10103 closed bug (worksforme)

jQuery bug when next() and live() are used together

Reported by: tolomei Owned by:
Priority: low Milestone: None
Component: traversing Version: 1.6.2
Keywords: Cc:
Blocked by: Blocking:

Description

Informations about bug:

Versions of jQuery where bug occurs:

  • jQuery 1.6.2
  • jQuery 1.5.2
  • jQuery 1.4.4
  • jQuery 1.3.2
  • jQuery 1.2.6

Browsers where bug occures:

  • Chrome v13.0.782.122
  • Mozilla Firefox 5.0
  • Internet Explorer 9.0
  • Opera 11.50

Operating system where bug was tested:

  • Windows 7

JSFiddle link to see bug:

Kind Regards. tolomei

Change History (4)

comment:1 Changed 7 years ago by tolomei

Edit: Bug occurs also in Mozilla Firefox 6.0.

comment:2 Changed 7 years ago by addyosmani

Component: unfiledtraversing
Priority: undecidedlow
Resolution: worksforme
Status: newclosed

Thanks for submitting a ticket. As per our 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.'

This is why you're running into issues with .next() and .live(). If as per our docs, you instead select 'b' with a class selector and call live directly after, you'll see that there are no issues with using .live(). http://jsfiddle.net/eqTS7/

comment:3 Changed 7 years ago by tolomei

Hi. Is it going to be fixed in any future? It would be pretty useful! :)

Thank you for help. I appreciate :)

Greetings Team! tolo

Last edited 7 years ago by tolomei (previous) (diff)

comment:4 Changed 7 years ago by dmethvin

The .live() method has always been documented as $("selector").live( ... ) and traversing methods should not be used before it. See the documentation, it's very clear:

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.

For new jQuery work, use .delegate() instead.

Note: See TracTickets for help on using tickets.