JavaScript prompt() won't work in AppJS

73 Views Asked by At

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);
1

There are 1 best solutions below

4
kvn On

AppJS has overridden the default window.prompt method.

Here is the Google groups discussion thread.