Bug Tracker

Opened 4 years ago

Closed 4 years ago

#12610 closed bug (fixed)

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:


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/

Change History (3)

comment:1 Changed 4 years ago by dmethvin

  • Component changed from unfiled to event
  • Milestone changed from None to 1.9
  • Priority changed from undecided to low
  • Status changed from new to open

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

comment:3 Changed 4 years ago by Sai Wong

  • Resolution set to fixed
  • Status changed from open to closed

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

Changeset: 5228f0a61843db2bc93ff441ea748aa5e0ce08f4

Note: See TracTickets for help on using tickets.