Bug Tracker

Opened 14 years ago

Closed 14 years ago

#4371 closed bug (invalid)

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

Description (last modified by brandon)

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 (2)

comment:1 Changed 14 years ago by brandon

Description: modified (diff)

comment:2 Changed 14 years ago by brandon

Resolution: invalid
Status: newclosed

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.

Note: See TracTickets for help on using tickets.