Bug Tracker

Modify

Ticket #11432 (closed bug: invalid)

Opened 15 months ago

Last modified 15 months ago

live() with parent()

Reported by: 66Ton99 Owned by:
Priority: low Milestone: None
Component: event Version: git
Keywords: Cc:
Blocking: Blocked by:

Description

<body>
  <div>
   <div id="id_div"></div>
   <a>link</a>
  </div>
  <script>
    jQuery('#id_div').parent().find('a').live('click', function() { alert('Click'); });
  </script>
</body>

And after click on link you will receive error "Uncaught Error: Syntax error, unrecognized expression: )" If change live to click everything works fine

Change History

comment:1 Changed 15 months ago by 66Ton99

 http://jsfiddle.net/NzYbe/ - Ubuntu 8.04 Chrome 17.0.963.38 beta & Firefox 10

comment:2 Changed 15 months ago by sindresorhus

  • Priority changed from undecided to low
  • Resolution set to invalid
  • Status changed from new to closed
  • Component changed from unfiled to event

.live() docs:

Chaining methods is not supported. For example, $("a").find(".offsite, .external").live( ... ); is not valid and does not work as expected.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.