Modify ↓
Ticket #4813 (closed bug: invalid)
remove() can't unbind the event which created by live()
| Reported by: | kai.ma | Owned by: | brandon |
|---|---|---|---|
| Priority: | major | Milestone: | 1.4 |
| Component: | event | Version: | 1.3.2 |
| Keywords: | remove | Cc: | |
| Blocking: | Blocked by: |
Description
when we binded a CLICK event by live("click",funciton(){}),
first,remove a DOM by remove(),
Second,create this DOM above and bind CLICK event by live() again. we will find that there are two CLICK events.
Change History
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.

This is the whole purpose of .live(). It does event delegation so that manipulating the DOM does not mean you have to worry about the events being unbound and having to rebind them. If you don't want the event to exist anymore, use .die() or just use regular .bind().