Skip to main content

Bug Tracker

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/

Attachments (0)
Change History (3)

Changed September 27, 2012 01:03AM UTC by dmethvin comment:1

component: unfiledevent
milestone: None1.9
priority: undecidedlow
status: newopen

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

Changed October 15, 2012 07:38PM UTC by saiwong comment:2

Changed October 20, 2012 02:09PM UTC by Sai Wong comment:3

resolution: → fixed
status: openclosed

Fix #12610, remove unneeded window.event. Close gh-968.

Changeset: 5228f0a61843db2bc93ff441ea748aa5e0ce08f4