javascript - close chrome app with escape key -
i'm trying create web app chrome , need help. want app made close when user presses escape key (27) , don't know how that.
i have tried piece of code found doesn't work.
window.onload = function() { $(document).keyup(function(e) { if (e.keycode == 27) { // escape key maps keycode `27` window.close(); } });
}
try window.close()
.
var pressedkeyvalue = keyevent.keycode; if(pressedkeyvalue == 27) { window.close(); }
Comments
Post a Comment