Side navigation
#12610 closed bug (fixed)
Opened September 26, 2012 03:21AM UTC
Closed October 20, 2012 02:09PM UTC
jQuery.event.dispatch should remove window.event
Reported by: | snandy | Owned by: | |
---|---|---|---|
Priority: | low | Milestone: | 1.9 |
Component: | event | Version: | 1.8.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
jQuery use addEventListener/attachEvent to add event handler.
when use addEventListener, the event object will pass in handler's first argument.
attachEvent is the same as addEventListener when get the event object in IE6/7/8.
So, in the method jQuery.event.dispatch, the first line
event = jQuery.event.fix( event || window.event );
should modify as
event = jQuery.event.fix( event );
see testcase in IE6/7/8: http://jsfiddle.net/aLaD3/1/
By jove, I think you're right! This is leftover from the original "Dean Edwards" code which hooked events via the
.onclick()
etc. properties. It was removed in jQuery 1.2, back in 2007. http://code.jquery.com/jquery-1.1.js