I have strange behavior in IE8 that I cannot explain the execution of the following JavaScript function:
function getStatus() {
var action = "/Device/Status";
$.getJSON(action, function (data) {
$.each(data, function (i, e) {
$('#btnEmergency' + e.BoreId).val(e.InEmergency ? "On" : "Off");
});
});
}
When Fiddler is loaded, I verify that the following JSON results are returned (note that InEmergency is false for all holes):
[{"BoreId":1,"InEmergency":false},{"BoreId":2,"InEmergency":false},{"BoreId":3,"InEmergency":false},{"BoreId":4,"InEmergency":false},{"BoreId":5,"InEmergency":false},{"BoreId":6,"InEmergency":false}]
Strange, e.InEmergency returns true for line 1 (only in IE8 (I have not tested other versions of IE, I mean that it works correctly in Chrome, Firefox and Safari)), as a result, the button value is set to "On" . Am I missing something that should be obvious?
senfo source
share