I am a fairly decent javascript programmer, but do not have a deep understanding of the DOM, this question should be fairly simple for any good programer, I hope.
I am trying to use the Jquery.Hotkeys lib. here’s what I noticed:
if I do:
$(document).ready( function(){
$(document).bind('keydown', 'ctrl+q', alertworld);
});
It works perfectly. but when I do
$(document).bind('keydown', 'ctrl+q', alertworld);
It binds every single keydown press to the alertworld function. I just want to understand why it behaves so. I imagined it should work just fine in the second code example. Please help. thanx in anticipation