I am trying the following code for triggering a js method when space-bar is pressed within an input box.
$(\'#j1
The problem is not all browsers have the same implementations on keypresses. The solution would be to check all possible places where the key was registered. In this case: event.keycode and event.which
See this post for more info
jQuery Event Keypress: Which key was pressed?
EDIT
Finally dug up my old functions, this is the actual code that I use:
evt = (evt) ? evt : event;
var charCode = evt.which || evt.charCode || evt.keyCode || 0;