1

I'm making an app in AppJS, and the prompt() function wont work. I've looked it up, tried window.prompt() and many other things, but nothing has worked. I'm trying to see when the Esc key is pressed, then the person enters the password. If the password is correct, then the it will run window.close(). The prompt box does not popup.

window.addEventListener('keydown', function(e){
    if(e.keyCode == 27){
        var pw = prompt('Please enter the password.');
        if(pw == 'password') window.close();
    }
}, false);
Michał Perłakowski
  • 88,409
  • 26
  • 156
  • 177
  • > AppJS project has not been actively developed for a few years. Please check out NW.js or Electron instead. – Michał Perłakowski May 25 '16 at 16:59
  • 4
    *"Websites please."* Is searching *really* that hard? – T.J. Crowder May 25 '16 at 17:01
  • I've been working in AppJS, and now how it works. I don't fell like learning a new JS. Is there a way to use `prompt()` in AppJS? – Teacher of Things May 25 '16 at 17:05
  • I'm sorry, but I need to use AppJS, because the app i'm working on is a 'Kids only play ABCYa.com games' and don't mess up your computer. AppJS allows you to not display the normal window controls, and I need a way to close it, and not have button with an 'X', kids now to press that to close it, and they need to only stay on ABCYa.com. – Teacher of Things May 25 '16 at 17:23

1 Answers1

3

AppJS has overridden the default window.prompt method.

Here is the Google groups discussion thread.

Michał Perłakowski
  • 88,409
  • 26
  • 156
  • 177
kvn
  • 2,210
  • 5
  • 20
  • 47