title: jQuery redirect to another file
body: <p>I am trying to direct to another file after successful login. However, it doesn't seem that I was able to go to b.html after login successfully alert is displayed. It seems to be remain in the same page. I have tried <code>document.location.href</code>,  <code>window.location.replace</code> but it doesn't seem to work</p>
  
  <pre><code>&lt;script&gt;
      window.onload = function() {
          document.addEventListener("deviceready", init, false);
      }
  
      function init() {
          document.getElementById("btnSave").addEventListener("click", saveData, false);
          document.getElementById("btnGet").addEventListener("click", getData, false);
      }
  
      function getData() {
          var email1 = document.getElementById("email1").value;
          var pass1 = document.getElementById("password1").value;
          var email2 = window.localStorage.getItem("email");
          var pass2 = window.localStorage.getItem("pass");
          if (email1 == email2 &amp;&amp; pass1 == pass2) {
              alert("Login successfully");
              window.location.href = "/b.html";
          } else {
              alert("Invalid login credentials");
          }
      }
  &lt;/script&gt;
  &lt;form class="login-form"&gt;
      &lt;input type="email" id="email1" name="email1" placeholder="Email Address" required/&gt;
      &lt;input type="password" id="password1" name="password1" placeholder="Password" required/&gt;
      &lt;button id="btnGet" type="submit" name="submit"&gt;Login&lt;/button&gt;
  &lt;/form&gt;
  </code></pre>