Just ran into this one. The following is the code I was working with:
$.ajax({
type: "GET",
url: 'http://services.somewhere.com/MethodName',
data: { 'param1':'something', 'param2': 'somethingElse' },
cache: false,
dataType: 'json',
success: function(view) {
alert('success');
},
error: function(xhr, ajaxOptions, thrownError) {
alert(xhr.status);
alert(xhr.responseText);
alert(xhr.statusText);
}
});
This worked in IE 8, but not FF 3.5. The strange part, though, was that the xhr object in my error function didn't even contain anything in FF, whereas when I intentionally made the service fail in my IE testing my error object contained the server response. Turns out the fix was changing dataType to 'jsonp' instead of 'json'. I also added the contentType based on this post. More on jsonp...
$.ajax({
type: "GET",
url: 'http://services.somewhere.com/MethodName',
data: { 'param1':'something', 'param2': 'somethingElse' },
cache: false,
dataType: 'jsonp',
contentType: "application/json; charset=utf-8",
success: function(view) {
alert('success');
},
error: function(xhr, ajaxOptions, thrownError) {
alert(xhr.status);
alert(xhr.responseText);
alert(xhr.statusText);
}
});