我已经完成了关于此的每个stackoverflow帖子,但仍然无法弄清楚为什么它不起作用。
我有一个简单的jquery ajax帖子,除ie8和ie9之外的任何地方都可以使用。
服务器是asp.Net
Index.html有:
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
Jquery Post:
$.ajax({
// cache: false,
// crossDomain: true,
// contentType: "application/json; charset=utf-8",
type: "POST",
url: self.dom.API+"/api/xxx/InsertUser",
dataType: "json",
data: postData,
success: function(data){
if(data.Status == "Success"){
self.onSubmitSuccess();
}
else{
self.unknownError();
}
},
error: function(data){
}
});
我还添加了这个插件来对抗Xdomin安全问题。 https://github.com/jaubourg/ajaxHooks/blob/master/src/xdr.js
错误&amp;通过Charles回复
Response: {"Message":"An error has occurred."}
POST /api/xxx/InsertUser HTTP/1.1
Accept */*
Origin http://local.xxx.com
Accept-Language en-US
Accept-Encoding gzip, deflate
User-Agent Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)
Host xxx-api.xxx.com
Content-Length 206
Pragma no-cache
URL http://xxx-api.xxx.com/api/xxx/InsertUser
Status Complete
Response Code 500 Internal Server Error
Protocol HTTP/1.1
Method POST
Content-Type application/json; charset=utf-8
Client Address /127.0.0.1
Remote Address xxx.com/ipaddress