Reputation: 9417
I have an ajax call inside a javascript function that update a div with the result. This function is called every 2 seconds.
function RefreshNbrMsg() {
$.ajax({
url: 'helper/NewMessages.aspx',
success: function (data) {
$('#nbr_msg').empty().append(data);
}
});
}
$(document).ready(function () {
setInterval(RefreshNbrMsg, 2000);
});
My problem is that it's working perfectly with Chrome but not IE. In IE the div won't update.
I don't have any script error or messages. I can see in the network analyzer that the ajax call is done every 2 seconds.
/helper/NewMessages.aspx GET 304 text/html 108 B < 1 ms JS Library XMLHttpRequest
Any ideas ?
Upvotes: 1
Views: 225
Reputation: 3979
Try this :
function RefreshNbrMsg() {
$.ajax({
cache: false,
url: 'helper/NewMessages.aspx',
success: function (data)
{
$('#nbr_msg').empty().append(data);
}
});
}
$(document).ready(function () {
setInterval(RefreshNbrMsg, 2000);
});
Upvotes: 3