Related (but not a duplicate): Is JSON.stringify() supported by IE 8?
Also related (but a different IE version): JSON object undefined in Internet Explorer 8
I was working with QA to test a feature; the feature works perfectly on my system, but on his system he's getting a 'JSON is undefined` exception in his Developer console:
I, however, get no exceptions at all in mine.
Both of us are running the same code in Internet Explorer 11 in Compatibility View (although we're using slightly different versions of IE11, he's using 11.0.9600.18617 and I'm using 11.953.14393.0).
"About" dialog from his computer:
"About" dialog from mine:
And here's the relevant code:
function GetNewList() {
jQuery.ajax({
url: "MyAspxPage.aspx/GetServiceInformation",
type: 'post',
// It apparently complains about this line for him
data: JSON.stringify({
"scheduleDate": jQuery('#ATextBox').val()
}),
dataType: 'json',
processData: false,
contentType: 'application/json; charset=utf-8',
// TODO: Error?
complete: function(response, status) {
if (status == 'success') {
// Presumably, this is a problem too
var jsonParsed = JSON.parse(response.responseText)
// Get my dropdown menu
var dropdown = document.getElementById('MyDropDown')
// Remove all of the existing options
var length = dropdown.options.length
for (i = 0; i < length; i++) {
dropdown.remove(0)
}
// Add all of the current objects
jsonParsed.d.each(function(element) {
var option = document.createElement('option')
option.value = element.ServiceTypeId;
option.text = element.ServiceTypeName;
dropdown.add(option)
})
// Re-add --Select--, but only if there are other options. Otherwise leave it empty.
if (jsonParsed.d.length > 0) {
var option = document.createElement('option')
option.value = 0
option.text = '--Select--'
dropdown.add(option)
dropdown.disabled = false;
} else {
dropdown.disabled = true
}
}
}
})
}
On a related note, I would like to just replace this completely with an UpdatePanel but I was having trouble getting it working.
Does anyone know what could be causing this, and how I might fix it?


