I'm using Ubuntu 10 and trying out the below code in Firefox 3.6 and Chrome 5.
$(document).ready(function(){
$(document).bind("keypress", function(e){
alert("Pressed");
});
});
Surprisingly the above code works well in FF3.6. i.e. for every key pressed, I'm getting an alert box.
But in Chrome, i'm seeing a different behavior. For example, I'm not getting the alert box when I press page up/down, arrow up/down/left'right keys (unfortunately, these are the key events that I desperately want to track).
Does anyone why Chrome is not binding the 'keypress' event to certain keys, like page up/down, arrow left/right?