Bug Tracker

Modify

Ticket #4813 (closed bug: invalid)

Opened 4 years ago

Last modified 4 years ago

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

comment:1 Changed 4 years ago by brandon

  • Status changed from new to closed
  • Resolution set to invalid

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().

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.