Bug Tracker

Modify

Ticket #4371 (closed bug: invalid)

Opened 4 years ago

Last modified 4 years ago

Event handling discrepancies for IE 7.0

Reported by: yoichi Owned by: brandon
Priority: major Milestone: 1.3.2
Component: event Version: 1.3.2
Keywords: keydown Cc:
Blocking: Blocked by:

Description (last modified by brandon) (diff)

While all browsers will handle this:

$(document).ready(function() {
	$(window).keydown(function() { alert('OK'); });
});

IE7 requires it to look like

$(document).ready(function() {
	$(document).keydown(function() { alert('OK'); });
});

(notice 'document' instead of 'window' inside the first handler.) The same *probably* applies to 'keyup' and 'keypress'.

Change History

comment:1 Changed 4 years ago by brandon

  • Description modified (diff)

comment:2 Changed 4 years ago by brandon

  • Status changed from new to closed
  • Resolution set to invalid

The window object in IE does not have key events.  http://msdn.microsoft.com/en-us/library/ms535873(VS.85).aspx#

The correct way to bind those events is to bind to the document.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.