Internet Explorer9で配置されたjQueryajaxを使用すると、応答本文でデータを取得していますが、成功関数に渡されません。どうすればそれを機能させることができますか?
例:
...
$.ajax({
async : false,
type: 'PUT',
contentType: 'application/json',
url: updateUrl,
data: JSON.stringify(model),
dataType: 'json',
success: function(data) {
console.log("Here!");//it comes here
console.log(data);//it logs undefine at ie, firefox and etc is logging data
r = resultResponse(data);
},
error: function(data) {
try {
r = error($.parseJSON(data.responseText));
} catch (err) {
//Handle error
}
}
});
...
ネットワークをデバッグしたところ、応答の本文は次のとおりです。
{"message":"Connection is successful","status":"success"}
ただし、InternetExplorerの成功関数ではデータが定義されていません。
何か案は?
PS 1:応答ヘッダーのコンテンツタイプを設定せずにサーバーからデータを送信すると、それが機能するのは奇妙ですか?
PS 2:私の応答ヘッダーは次のとおりです。
Key Value
Response HTTP/1.1 200 OK
Server Apache-Coyote/1.1
Content-Type application/json;charset=UTF8
Transfer-Encoding chunked
Date Thu, 02 Aug 2012 15:50:44 GMT