In Chrome, jquery code does not work, but it works in Firefox. What could be the magic?
$(document).keydown(function(e) { if (e.ctrlKey) { alert('work'); }); });
OC Ubuntu 12.04
In Chrome, jquery code does not work, but it works in Firefox. What could be the magic?
$(document).keydown(function(e) { if (e.ctrlKey) { alert('work'); }); });
OC Ubuntu 12.04
Apparently the event object has no ctrlKey (in Chrome). Try e.keyCode. There you can use the comparison to catch the desired key. At ctrl code 17, judging by the table here
Source: https://ru.stackoverflow.com/questions/140074/
All Articles