jQuery.getJSON callback does not fire in IE7

724 Views Asked by At

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 )

1

There are 1 best solutions below

0
On

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.