Any idea why the following code will not continually update in IE6 & 8 but works perfectly fine in Chrome and FF.
$(document).ready(function () {
window.setInterval(function () {
$('div').each(function (index, item) {
var vm = $(item).text();
var env = "some url (cant show)";
$.ajax(env, {
URL: env,
type: "GET",
dataType: "html",
success: function (data) {
var style = $(data).filter('div');
$(item).replaceWith(style);
},
error: function () {
$(item).css('background', '#f00');
}
});
});
}, 10000);
});
The divs will change once, then never again. Whereas, in Chrome and FF the divs change every 10 seconds as they are meant too.
Thank you for your help!
Try to write your script like (didn’t test it)…