title: How to Create a Simple If Else Statement in Eclipse, PhoneGap
body: <p>How will I create a simple onClick() if else statement. that when the user hits the backbutton it will lead to the previouse page or activity in android? below is my code but i know there something missing. and can you please help me out? I am using eclipse with phonegap for Android. </p>
  
  <p>Here is my Code:</p>
  
  <pre><code>&lt;script type="text/javascript" charset="utf-8"&gt;
  document.addEventListener("backbutton", onBackKeyDown, false);
  &lt;/script&gt;
  &lt;script type="text/javascript" charset="utf-8"&gt;
  function onBackKeyDown() {
  /* WHAT SHOULD I PUT IN HERE? any suggestions?*/
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>Many thanks to all of you guys.</p>