【发布时间】:2013-09-09 05:08:56
【问题描述】:
我正在从 JavaScript 调用 SOAP WebService。在 IE 中,我的代码可以工作,但在 Firefox 上,使用 textStatus = "error"、xhr.status = 0 和 errorThrown 调用错误函数。我尝试了不同的答案,在 SO 上找到,但无法解决问题。
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"
});
浏览器版本:IE 9、Firefox 23.0.1
【问题讨论】:
-
是否有任何错误记录到 Firefox 的开发者控制台?
-
我检查了 Web 开发人员错误控制台,没有错误...