I've got some jQuery (1.6.2, latest stable) code which is working in Chrome, Firefox, Safari, IE7 and IE8... but IE9 is failing to parse my json ajax response. The json is valid and I've run 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+"|");
}
});
The error handler is the one jQuery calls (IE9 only). The xhr.status=200, the errorString=parseerror and the exception=SyntaxError JSON.parse
My json IS valid and I've even checked with using an ultimately simple json string:
{"foo":"bar"}
I have verified using xhr.responseText that there are no leading or trailing spaces on the json.
Why is this failing in IE9?