Json problem with Page Method call on IE 8.
Posted
by ProfK
on Stack Overflow
See other posts from Stack Overflow
or by ProfK
Published on 2010-05-03T10:56:26Z
Indexed on
2010/05/03
12:28 UTC
Read the original article
Hit count: 242
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);
};
© Stack Overflow or respective owner