I have following bit of code which I am tring to run
$.ajax({
cache: false,
url: './animationPlay.php',
data: 'animation='+text,
type: 'POST',
datatype: 'text',
success: function(data) { alert("succsess") },
error: function(ts) { alert('error:'+ts.responseText) }
});
I have seen how to catch ajax query post error? and jQuery $.get or $.post to catch page load error (eg. 404) but it doesn't work for my code.It is simply set to "error". How do I get more detail about what's gone wrong?
Thanks in advance.
EDIT: I tried
error: function(xhr, textStatus, error){
console.log(xhr.statusText);
console.log(textStatus);
console.log(error);
}
I got error, error, an empty string in console. What does it mean?