- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am building a game using he Basic Canvas Game template. The last component I want to add to the app is an exit button which I have been unable to get working. The cordova example seen below does not work and I get the following output: "onDeviceReady is not defined" What am I doing wrong. (Very FRUSTRATED!).
navigator.app.exitApp();
full example :
<script type="text/javascript"">
function onLoad()
{
document.addEventListener("deviceready", onDeviceReady, true);
}
function exitFromApp()
{
navigator.app.exitApp();
}
</script>
- Tags:
- HTML5
- Intel® XDK
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
did you set it to pas variables (e.g. add () to the end)?
This may be helpful: http://stackoverflow.com/questions/8982728/deviceready-not-working-in-phonegap-application-how-to
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Programatically exiting from apps is discouraged, and Apple will not approve your app if they see it. Some users have tried to do it, but a lot have failed. Sorry, I dont have any code sample/plugin that does it to give you.
![](/skins/images/7B0AB6865064EAE32B30EC9A4E94B48A/responsive_peak/images/icon_anonymous_message.png)
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page