title: How can I use jQuery to redirect to another page?
body: <p>I have a log-in form that I want to validate and redirect (if the username and password are correct) with jQuery, and the redirect isn't working. </p>
  
  <p>This is my code: </p>
  
  <pre><code>$(document).ready(function() {
      $('#lc-login').click(function() {
          var username = $('#username').val();
          var pass = $('#pass').val();        
  
          if (testUser(username) === true &amp;&amp; testPass(pass) === true) {            
              window.location.replace("http://www.domain.com/home.html");
          } else {
              alert('warning message');
          }
      });
  });
  </code></pre>
  
  <p>I've try replacing the <code>window.location.replace</code> with <code>window.location.href</code> and still nothing. I should say that the testUser and testPass are working fine, because if I add a simple <code>alert('the validation is ok!')</code>, the message is appearing on my screen.</p>