Modify ↓
Ticket #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: | |
| 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: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.
Note: See
TracTickets for help on using
tickets.
