我的以下代码适用于Chrome和Mozilla,但在IE9 +版本中无效。 我正在使用Ember JS。
$.ajax({
type: "POST",
contentType: "application/json; charset=UTF-8",
url: OrgPortalENV.ABC.API_URL + "/test",
data: JSON.stringify( jsonPayload )
})
// Received an HTTP 200 OK response
.done(
function(data) {
alert("done");
},
$.proxy(ABCAjax.handleHttpOkResponse, this)
)
// Received an HTTP 4XX or 5XX error response
.fail(
function(jqXHR, data) {
alert("fail");
// End the nice loading animation
},
$.proxy(ABCAjax.handleHttpErrorResponse, this)
);