title: Exit from app when click button in android phonegap?
body: <p>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</p>
  
  <pre><code>         function callAnothePage()
           {
              window.location = "test.html";
           }
  </code></pre>
  
  <p>The second page has one button, when clicked I want to exit from the application. I used the following</p>
  
  <pre><code>       function exitFromApp()
         {
              navigator.app.exitApp();
         }
  </code></pre>
  
  <p><code>test.html</code> code,</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  
  &lt;head&gt;
      &lt;script type="text/javascript" charset="utf-8" src="cordova-2.0.0.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" charset="utf-8"&gt;  
          function onLoad()
          {
              console.log("device reday !!!!")
              document.addEventListener("deviceready", onDeviceReady, true);
          }
          function exitFromApp()
          {
              console.log("in button");
              navigator.app.exitApp();
          }
      &lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body onload="onLoad();"&gt;
      &lt;h4&gt;&lt;center&gt;Login Page&lt;/center&gt;&lt;/h4&gt;
  
      &lt;input type="submit" onclick="exitFromApp()" value="exit"/&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>But it is not working.</p>