diff options
author | jeresig <jeresig@gmail.com> | 2010-02-26 11:32:12 -0500 |
---|---|---|
committer | jeresig <jeresig@gmail.com> | 2010-02-26 11:32:12 -0500 |
commit | 7f5179b65431b77e89fa32623a5000e3630c191c (patch) | |
tree | 7a90bfedfc97d6f31973178dd09d39925f63fe32 /src/event.js | |
parent | 28b489bfc8ad240b01e63ed93634f2b8770332a3 (diff) | |
download | jquery-7f5179b65431b77e89fa32623a5000e3630c191c.tar.gz jquery-7f5179b65431b77e89fa32623a5000e3630c191c.zip |
Make sure that unbinding on a plain javascript object works correctly. Fixes #6184.
Diffstat (limited to 'src/event.js')
-rw-r--r-- | src/event.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/event.js b/src/event.js index 1e2d33dd6..bfe2dd1af 100644 --- a/src/event.js +++ b/src/event.js @@ -525,10 +525,14 @@ jQuery.event = { var removeEvent = document.removeEventListener ? function( elem, type, handle ) { - elem.removeEventListener( type, handle, false ); + if ( elem.removeEventListener ) { + elem.removeEventListener( type, handle, false ); + } } : function( elem, type, handle ) { - elem.detachEvent( "on" + type, handle ); + if ( elem.detachEvent ) { + elem.detachEvent( "on" + type, handle ); + } }; jQuery.Event = function( src ) { |