This question already has an answer here:
i have a ajax post from my form. when it succeed, i want to redirect to another web page..
What i have now:
$.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);
}
});
Is there someone who can help me? because nothing i tried works.
</div>