title: How do I use jQuery to redirect?
body: <p>I am using a HTML form to submit to a jQuery validation which then sends information to a PHP processing page through ajax.</p>
  
  <p>Everything works 100% apart from when everything comes back true I can't get the page to redirect to a success page.</p>
  
  <p>The code I have is:</p>
  
  <pre><code>$.post(url,{ username: value_login.val(), firstname: value_firstname.val(), lastname: value_lastname.val(), email: value_email.val(), password: value_password.val()} , function(data) {
  
      if(data == 'success'){
  
          window.location.href = "http://example.com/Registration/Success/";
      } else {
         $('#error').text('error');
      }
  
  });
  </code></pre>
  
  <p>I'm thinking you can't redirect using the <code>window.location.href</code> function.</p>