IE does not update display after callpback panel updates DOM
I have an update panel on an ascx page using .Net 3.5.
User enters data, initiates callback, and ajax updates the DOM.
Usually everyone is hunky dory. The DOM gets updated from time to time and IE doesn't bother with the display refresh. The entire updated area appears to be empty.
As soon as the user does something that triggers an update, such as resizing the window, the data will instantly appear on the screen, but until then.
Why is this? What could be causing this? How can this be fixed?
a source to share
You can "fix" it by switching to real browsers :)
Indeed, you could fix this according to the trick I found on this page .
Basically, you need to create an empty node and delete it locally after updating the DOM with new content :
var t = document.createTextNode('temp text');
element.appendChild(t); // Not sure if this is any element
// or one inside your new DOM nodes.
setTimeout(function() { t.parentNode.removeChild(t); }, 0);
On this page, the author says:
Even with my "fix" it only works if the user moves the window's mouse cursor back and forth.
But I think that's as good as it gets ... I think IE cannot trigger an update unless there is some activity in the browser window to save processing time.
This is a long known bug causing annoyance in IE, although I can't find it anywhere. In fact, even Opera has this bug from time to time.
Also, even if you solve it with this trick, make sure every chunk of HTML is valid. You can check it out at http://validator.w3.org . If a piece of code is invalid, you can't blame the browser for not understanding what you mean.
a source to share