Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8492101
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T22:37:19+00:00 2026-06-10T22:37:19+00:00

I am new to phonegap. I have prepared one sample application. My application has

  • 0

I am new to phonegap. I have prepared one sample application. My application has 2 pages, the first page has one button, when clicked the second page will open. It is working fine using the following

         function callAnothePage()
         {
            window.location = "test.html";
         }

The second page has one button, when clicked I want to exit from the application. I used the following

       function exitFromApp()
       {
            navigator.app.exitApp();
       }

test.html code,

<!DOCTYPE html>
<html>

<head>
    <script type="text/javascript" charset="utf-8" src="cordova-2.0.0.js"></script>
    <script type="text/javascript" charset="utf-8">  
        function onLoad()
        {
            console.log("device reday !!!!")
            document.addEventListener("deviceready", onDeviceReady, true);
        }
        function exitFromApp()
        {
            console.log("in button");
            navigator.app.exitApp();
        }
    </script>
</head>

<body onload="onLoad();">
    <h4><center>Login Page</center></h4>

    <input type="submit" onclick="exitFromApp()" value="exit"/>

</body>
</html>

But it is not working.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T22:37:21+00:00Added an answer on June 10, 2026 at 10:37 pm

    Try this code.

    <!DOCTYPE HTML>
    <html>
      <head>
        <title>PhoneGap</title>
    
            <script type="text/javascript" charset="utf-8" src="cordova-1.5.0.js"></script>      
            <script type="text/javascript" charset="utf-8">
    
                function onLoad()
                {
                      document.addEventListener("deviceready", onDeviceReady, true);
                }
    
                function exitFromApp()
                 {
                    navigator.app.exitApp();
                 }
    
            </script>
    
        </head>
    
        <body onload="onLoad();">
           <button name="buttonClick" onclick="exitFromApp()">Click Me!</button>
        </body>
    </html>
    

    Replace src=”cordova-1.5.0.js” with your phonegap js .

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am new in phonegap development. I have one html page which contains one
I am new to PhoneGap development. My PhoneGap application has a login page and
I am new to phonegap and android, I have create a hello world application
I am new to mobile application development with PhoneGap. I have created a form
I just started with PhoneGap development and have my first sample android app running
I am new to Sencha Touch and Phonegap. I have one html file and
I am new to PhoneGap. I have developed a small PhoneGap application and it
we are new to phonegap, and planning to use phonegap to build the application
currently i using this code in phonegap application var xmlhttp = new XMLHttpRequest(); xmlhttp.open(GET,http://192.168.1.19:8080/searchMobile?categoryRequest=true,
I am relatively new to phonegap and I have recently set up HTTPS/SSL on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.