IE8 バージョン 8.0.7600 以前で ajax リクエストを作成すると、エラーまたは「Invalid JSON Promitive: undefined」が表示されますが、8.0.7601 以降では複製できません。誰かがそれを修正する理由または方法を知っていますか?
$.ajax({
url: defaults.url + (defaults.url.indexOf('?') > 0 ? '&' : '?') + 'r=' + Math.random(),
type: defaults.method,
contentType: 'application/json',
dataType: defaults.dataType,
data: ko.toJSON(defaults.data),
beforeSend: function (xhr, settings) {
xhr.setRequestHeader("URL_REFERRER", config.urlReferrer);
xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
},
)}
コントローラ
public virtual JsonResult CompleteOrder(string id)
{
_entitlementsService.CompleteOrder(AuthenticateManager.CurrentUserProfile.UserModel.UserId, id);
return Json(new SuccessResponse("Order completed"));
}
リクエスト
Request URL:http://localhost:16253/DashboardSetup/Entitlements/CompleteOrder/c8e053d9-a458-11e1-8dd0-001cc4565d26?r=0.8639180345926434
Request Method:POST
Status Code:200 OK
Request Headersview source
Accept:*/*
Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8
Connection:keep-alive
Content-Length:0
Content-Type:application/json
Cookie:MYNGCONNECT=56053B332B26A0FD9D0A31C5FC83868281D876DB1F365034306F6CB3A64C5B2F7
Host:localhost:16253
Origin:http://localhost:16253
Referer:http://localhost:16253/DashboardSetup/Entitlements/Entitlement?SearchResults=True&id=c8e053d9-a458-11e1-8dd0-001cc4565d26
URL_REFERRER:http://localhost:16253/DashboardSetup/Entitlements
User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.57 Safari/536.11
X-Requested-With:XMLHttpRequest
Query String Parametersview URL encoded
r:0.8639180345926434