Skip to main content

Bug Tracker

Side navigation

#10103 closed bug (worksforme)

Opened August 22, 2011 04:02AM UTC

Closed August 22, 2011 05:37AM UTC

Last modified August 22, 2011 01:46PM UTC

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

Attachments (0)
Change History (4)

Changed August 22, 2011 04:23AM UTC by tolomei comment:1

Edit:

Bug occurs also in Mozilla Firefox 6.0.

Changed August 22, 2011 05:37AM UTC by addyosmani comment:2

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/

Changed August 22, 2011 12:57PM UTC by tolomei comment:3

_comment0: Hi. \ Is it going to be fixed? \ It would be pretty useful! :) \ \ Thank you for help. \ I appreciate :) \ \ Greetings Team! \ tolo1314017912457506

Hi.

Is it going to be fixed in any future?

It would be pretty useful! :)

Thank you for help.

I appreciate :)

Greetings Team!

tolo

Changed August 22, 2011 01:46PM UTC by dmethvin comment:4

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.