I'm facing a problem when I create a program by PhoneGap.
in my program, I'm using a local index.html file in my main activity, after the index.html loaded, I'm using window.open to redirect my page to an external page from the other server.
window.open("http://192.168.0.11/test.html", '_self');
now the page redirect to test.html, cordova.js was included in test.html:
//included the cordova js file in test.html file
<script src="js/cordova.js"></script>
in test.html, I called the the "exitApp" method of cordora as following:
function onExit()
{
navigator.app.exitApp();
}
however, I saw the error message as following in ADT logcat: Uncaught TypeError: Cannot call method 'exitApp' of undefined
but this file is working when I call it by local e.g. file:///adnroid_asset/www/test.html
anyone can help me on this? thanks in advance.