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

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -