开发者

jQuery.getJSON callback does not fire in IE7

A valid JSON*, returned with correct HTTP headers:

Content-Type:application/json; charset=
开发者_开发技巧

Works in Chrome/FF, and IE7 is refusing to parse it.

Where do I look for clues?

 $.getJSON(url, null, function(data){ alert(data); /* never fires in IE7 */ });

(valid according to JSONLint )


Is the URL at another domain? IE's XDomainRequest was added in IE8, so you won't be able to make cross-domain ajax requests in IE7.

http://msdn.microsoft.com/en-us/library/cc288060%28v=vs.85%29.aspx

Use JSONP instead.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜