My jQuery:
jQuery.ajax({
url: "wahwahweewah",
type:"post",
dataType: 'json',
data: {
fizz: jQuery('#fizz').val(),
buzz: jQuery('#buzz').val(),
foo: "blah"
},
success: function(result) {
alert("Success!");
},
error: function(xhr){
alert("Error!");
}
});
When I run this in both IE and Chrome, I get the alert
defined inside my error handler:
Error!
In both those browsers' developer tools, I inspect the network request and see the following:
Response Headers
================
Response HTTP/1.1 200 OK
Server Apache-Coyote/1.1
Content-Type text/html;charset=utf-8
Transfer-Encoding chunked
Date Fri, 31 Oct 2014 15:41:37 GMT
Response Body
=============
Wah wah wee wah
Note that "Wah wah wee wah" is an appropriate response from my server (at this point).
So I ask: Why is my error handler executing?!? According to both browsers I'm getting a valid response from the server with a status of HTTP 200 OK. Ideas?