I am new to Phonegap, my application has a login page with username, password, login button and exit button. when I press the exit button, I want to close the application,
<body>
<script>
function exitFromApp()
{
navigator.app.exitApp();
}
</script>
<div data-role="header" data-position="fixed">
<a href="login.html" data-theme="b">Login</a>
<h1>Bird on Tree</h1>
<button type="button2" onclick="exitFromApp()">Exit</button>
</div>
The above was that I tried to close the application when I clicked a button. It works only when I am not registered in the application, if I logged in and try to close the application, click the button to show this error.
03-03 01:58:10.457: E/Web Console(1222): Uncaught TypeError: Cannot call method 'exitApp' of undefined at file:
Please help me solve this problem.
source
share