Modify ↓
Ticket #11432 (closed bug: invalid)
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: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.
Note: See
TracTickets for help on using
tickets.

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