I'm calling a SOAP WebService from JavaScript. In IE my code works, but on Firefox the error function is called with textStatus = "error", xhr.status = 0 and errorThrown empty. I tried different answers, found on SO, but couldn't solve the problem.
jQuery.support.cors = true;
jQuery.ajax({
url: serviceUrl,
beforeSend: function (xhr) {
xhr.setRequestHeader("SOAPAction", soapAction);
},
type: "POST",
dataType: "xml",
data: soap,
success: function(data, textStatus, jqXHR ) {
// report success
success.style.display='block';
},
error: function (jqXHR, textStatus, errorThrown) {
// report error
fail.style.display='block';
alert(textStatus + ": " + jqXHR.status + " / " + errorThrown);
},
contentType: "text/xml; charset=utf-8"
});
Browserversions: IE 9, Firefox 23.0.1