Strange Behavior Parsing JSON Within IE8 Strange Behavior Parsing JSON Within IE8 json json

Strange Behavior Parsing JSON Within IE8


Internet Explorer has different caching behaviour compared to other browsers (inevitably). In particular, it tends to cache XMLHTTPRequest requests when that isn't useful.

The way around this is to add a useless parameter that changes with every request, to make it unique and therefore ensure that there is no cached value. Using the time in milliseconds is a very easy way to do this:

function getStatus() {    var action = "/Device/Status";    $.getJSON(action + '?_=' + (new Date()).getTime(), function (data) {        $.each(data, function (i, e) {            $('#btnEmergency' + e.BoreId).val(e.InEmergency ? "On" : "Off");        });    });}

Note that (a) this is how jQuery does cache: false in $.ajax calls and (b) if you have already got parameters in your URL, you will need to use &_= instead.


hi try using the browserss dom method eval() and see if that works out for you.. I am not sure if that is your problem.Else what I would suggest is to first evaluate the json strring to an object and then loop over the same abd verify it. My opinion is that looping is causing some problem in IE.