title: ajax success redirect not working
body: <p>i have a ajax post from my form. when it succeed, i want to redirect to another web page..</p>
  
  <p>What i have now: </p>
  
  <pre><code>$.ajax({
          type : 'POST',
          url : '/system/login.php',
          data : formData,
          dataType : 'json',
  
      success: function(data) {
          if(!data.success){
              if(data.errors.username){
                  alert(data.errors.username);
              }
  
              if(data.errors.password){
                  alert(data.errors.password);
              }
              if(data.errors.login){
                  alert(data.errors.login);
              }
          }
          else{
              location.href = "http://localhost/me.php"
          }
      },
      error: function(xhr){
       alert(xhr.responseText);
    }
  });
  </code></pre>
  
  <p>Is there someone who can help me? because nothing i tried works. </p>