以下内容在所有浏览器中均有效,除了IE(我正在测试IE 9)。
jQuery.support.cors = true;
...
$.ajax(
url + "messages/postMessageReadByPersonEmail",
{
crossDomain: true,
data: {
messageId : messageId,
personEmail : personEmail
},
success: function() {
alert('marked as read');
},
error: function(a,b,c) {
alert('failed');
},
type: 'post'
}
);
我有另一个使用 dataType: 'jsonp'
的函数,但我不需要在这个 AJAX 调用中返回任何数据。我的最后一招将是返回一些包装在 JSONP 中的胡言乱语,只是为了让它正常工作。
有没有想法为什么 IE 会在返回没有数据的 CORS 请求时出错?