I have jQuery (1.6.2, the latest stable) code that works in Chrome, Firefox, Safari, IE7 and IE8 ... but IE9 does not parse my ajax json response. Json is valid and I ran it through http://jsonlint.com/
$.ajax({ url: lookupURL, dataType: "json", cache: false, // don't cache the result contentType: "application/json", //tell the server we're looking for json success: function(data) { // do stuff with result }, error: function(xhr, errorString, exception) { alert("xhr.status="+xhr.status+" error="+errorString+" exception=|"+exception+"|"); } });
An error handler is a single jQuery call (IE9 only). Xhr.status = 200, errorString = parseerror and exception = SyntaxError JSON.parse
My json IS is valid, and I even checked using ultimately a simple json string:
{"foo":"bar"}
I checked using xhr.responseText that there are no leading or trailing spaces on json.
Why does this not work in IE9?
source share