I've got this javascript that works fine in Chrome but in IE the 'data' var passed in the Success function is always an empty string. What's more my handler is not even hit!
(jQuery 1.6.2)
$.ajax({
url: "/rb.ashx",
type: "GET",
data: ({ cmd: 'getpmcount' }),
async: true,
success: function (data) {
alert('unread 开发者_如何学Python[' + data + ']');
}
});
if however I add a dummy param to the outgoing data:
$.ajax({
url: "/rb.ashx",
type: "GET",
data: ({ cmd: 'getpmcount', x:'x' }),
async: true,
success: function (data) {
alert('unread [' + data + ']');
}
});
it works fine!!
Can anyone explain why this might be the case? I'd rather have it work properly than have this hack in place.
Thanks.
Looks like it was some strange caching issue. I added cache: false to the ajax calls and all is working. Odd.
精彩评论