Side navigation
#5856 closed bug (fixed)
Opened January 18, 2010 08:58PM UTC
Closed January 24, 2010 02:20AM UTC
Last modified January 26, 2011 12:38AM UTC
namespaced events remain on DOM object when calling remove()
Reported by: | martinbraun | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | 1.4.1 |
Component: | core | Version: | 1.4 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
There is a problem with deregistering handlers when an element is removed from the DOM. Executing the following code leads to the problem:
jQuery("#somediv").bind("click.namespace1",function(){ alert("click!"); });
jQuery("#somediv").remove();
While the events object in the element's data object is deleted correctly, the generic event handler remains registered on the element -> removeEventListener()/detachEvent() is not called.
Attachments (0)
Change History (3)
Changed January 24, 2010 02:20AM UTC by comment:1
component: | unfilled → core |
---|---|
resolution: | → fixed |
status: | new → closed |
version: | 1.3.2 → 1.4 |
Changed January 26, 2011 12:37AM UTC by comment:2
Fixes #5856. Adds document protocol at the beginning of URLs without protocol (thanks go to skrings for the initial pull request). Simplifies cross-domain detection regexp and logic as a consequence. Also took the opportunity to remove an unused variable. Unit test added.
Changeset: 0e5b341cc0f3f9bf0f6659e09704f2267cfdfdba
Changed January 26, 2011 12:38AM UTC by comment:3
Wrong bug number in the commit :(
Fixed.
http://github.com/jquery/jquery/commit/f06e0e5575bc8f82d0fcbd5880bb9d8ccf361bfa