Bug Tracker

Ticket #12610 (closed bug: fixed)

Opened 2 years ago

Last modified 2 years ago

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:
Blocking: Blocked by:

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/

Change History

comment:1 Changed 2 years ago by dmethvin

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

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 2 years ago by Sai Wong

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

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

Changeset: 5228f0a61843db2bc93ff441ea748aa5e0ce08f4

Note: See TracTickets for help on using tickets.