Json problem with Page Method call on IE 8.
- by ProfK
I have the following code that populates a select element with values from an ajax call, via a Page Method. In FF, the code works perfectly, in IE8 I get the error: 'ResourceList[...].id' is null or not an object. What can I look at here?
function readShift(jsonString) {
var shiftInfo = Sys.Serialization.JavaScriptSerializer.deserialize(jsonString);
var listItems = "";
listItems += "<option value='0'>[Unassigned]</option>";
for (var i = 0; i < shiftInfo.ResourceList.length; i++) {
listItems += "<option value='" + shiftInfo.ResourceList[i].id + "'>" + shiftInfo.ResourceList[i].name + "</option>";
}
$("#" + resourceListId).html(listItems);
};