So I changed the code from e.which to e.keyCode based on someone
else's entry and it works in Firefox, IE7 and IE8 and Safari. Not sure
if this is the best solution, but it is working right now.
- Mike

On Apr 2, 11:19 am, mberger <mberge...@gmail.com> wrote:
> The key capture events (keypress, keyup, keydown) all work fine in
> Firefox. But I can't get IE7 to do anything with them. Specifically, I
> am trying to capture the Enter key. I have tried both jquery 1.2.6 and
> 1.3.2
>
> Before trying to do anything with the key capture, this is all I am
> trying to do currently:
>
>   $("input").keydown(function(e){
>     if (e.which == 13){
>      alert("Enter key pressed");
>     }
>   });
>
> I register this event on document ready. As I said, it works fine in
> Firefox and Safari. In ie, the alert does not fire at all. If I try to
> just alert(e.which), the alert fires and says "undefined" for every
> key, and reports correctly in Firefox. Interestingly, the demo 
> athttp://docs.jquery.com/Events/keypressworks fine in ie. However,
> looking at that code its embedded in a frame and in a try catch block
> and in a window.onload, not a jquery document ready. Anyone got
> suggestions?
> Thanks,
> - Mike

Reply via email to