Try this: $('#message'). Keyup(function(e){ if(e. KeyCode == 13){ //your code probably want e.preventDefault() as well } }) I've found keypress implementation to not be so cross-browser friendly.
Just a thought Edit : I now remember why this doesn't work in IE8. The enter key (keycode 13) is considered a "Special Key" (as well as others like arrow keys on the keyboard) IE does NOT fire a keypress event for "Special Keys" which is why I had to use keyup You can find more info here: quirksmode.org/dom/events/keys.html Look under "Special Keys.
Try this: $('#message'). Keyup(function(e){ if(e. KeyCode == 13){ //your code probably want e.preventDefault() as well } }); I've found keypress implementation to not be so cross-browser friendly.
Just a thought. Edit: I now remember why this doesn't work in IE8. The enter key (keycode 13) is considered a "Special Key" (as well as others like arrow keys on the keyboard) IE does NOT fire a keypress event for "Special Keys" which is why I had to use keyup.
You can find more info here: quirksmode.org/dom/events/keys.html Look under "Special Keys.
Marked as answer without an upvote :P makes sense to me! – Jeremy Battle Mar 7 at 18:25.
E. Which doesn't work in IE try e. KeyCode, also you probably want to use keydown() instead of keypress() if you are targeting IE.
See unixpapa.com/js/key.html for more information. JQuery keypress() event not firing?
Thank you @Mike C. – Jessu Mar 5 at 13:30.
I've encountered this too, particularly with tables using an onKeyDown() in IE7. Other keys fire fine but enter is tricky. I solved mine by moving my onkeydown() trigger about in the HTML, from certain locations it wouldnt pick up enter but would gather others.
If I recall I had it originally in the body tag and moving it to a just inside the body immediately allowed me to detect enter. I was using jsp with a switch but I don't think its a great deal different.
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.