title: Implementing Back Button functionality for wp8 cordova application
body: <p>I tried to implement the back button functionality in my wp8 cordova application , which on pressing the hardware back button on device should navigate to the previous page of the app .</p>
  
  <p>What i have done </p>
  
  <pre><code>function onLoad() {
      document.addEventListener("deviceready", init, false);
      document.addEventListener("resume", onResume, false);
      document.addEventListener("backbutton", onBackKeyDown, false);
  }
  
  function init() {
    //some code
  }
  
  function onResume() {
    //some code   
  }
  
  function onBackKeyDown() {
     window.history.back();
     return false; 
  }
  </code></pre>
  
  <p>I also tried replacing the "window.history.back();" with "navigator.app.backHistory();" which also doesnot seems to work </p>
  
  <p>Then i tried putting the code in try catch block </p>
  
  <pre><code>try
  {
  navigator.app.backHistory();
  //window.history.back(); 
  }
  catch (e)
  {
  console.log("exception: " + e.message); 
  }
  </code></pre>
  
  <p>which also seems to fail .Whatever I do the app seems to exit out of the app rather than moving backward and the funny thing is when i try this in the IE console it seems to work perfectly </p>
  
  <p>Please help with this guys </p>
  
  <p>Thanks in advance</p>