Skip to content
Permalink
Browse files
detachEvent is unnecessary since we're nulling div. Fixes #8873.
  • Loading branch information
timmywil committed May 25, 2011
1 parent 657b197 commit b8fc9d1
Showing 1 changed file with 1 addition and 2 deletions.
@@ -109,11 +109,10 @@ jQuery.support = (function() {
}

if ( !div.addEventListener && div.attachEvent && div.fireEvent ) {
div.attachEvent( "onclick", function click() {
div.attachEvent( "onclick", function() {
// Cloning a node shouldn't copy over any
// bound event handlers (IE does this)
support.noCloneEvent = false;
div.detachEvent( "onclick", click );
});
div.cloneNode( true ).fireEvent( "onclick" );
}

1 comment on commit b8fc9d1

@SergioMorchon
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is necessary due to IE8 memory leaks on non detached events, even nulling elements.

Please sign in to comment.