This question is locked. New answers and comments are not allowed.
I am trying to exit an app by using the navigator.app.exitApp function and not succeeding at it. Here is the code:
$(document).ready(function() {
if (NotLoggedInToDB) {
alert('Not logged in to DB');
navigator.app.exitApp();
}
...
}
I get to the alert but the app doesn't exit. As you can see, this code in right at the beginning of the document ready handler, but it doesn't work there or anywhere else in the code.
Another question is this: what is the navigator object and where does it come from? At what point does it come into existence?
What am I doing incorrectly?
Thanks in advance for your help.
$(document).ready(function() {
if (NotLoggedInToDB) {
alert('Not logged in to DB');
navigator.app.exitApp();
}
...
}
I get to the alert but the app doesn't exit. As you can see, this code in right at the beginning of the document ready handler, but it doesn't work there or anywhere else in the code.
Another question is this: what is the navigator object and where does it come from? At what point does it come into existence?
What am I doing incorrectly?
Thanks in advance for your help.