Showing posts with label IE. Show all posts
Showing posts with label IE. Show all posts

Tuesday, February 03, 2009

forcing repaint DOM in IE6 and IE7?

I have loop that makes server-side Ajax calls on each iteration, and returns data. This could be 50 iterations, 500, 5000, whatever. Upon each iteration, I update that particular row with a server-side response (i.e. "success" or "fail"), and then update the total count processed ("26 out of 432 processed"). -- I update the innerHTML of a div or span, and another div showing the total number of records processed (at the end of an iteration, or in the onComplete callback handler of the Ajax.Request). That is all working perfectly fine... in Firefox, Safari, and every other browser except IE6 and IE7.

I have tried IE hacks such as adding a class to the div, and dropping a class from the div, adding and dropping child nodes from the div, etc -- to attempt to force IE to repaint, I have tried waiting a small interval, to no avail. If you pop up an alert("hai"); at the end of the iteration, the the IE6 and IE7 DOM will repaint with the updated values. (btw, how dumb is that?)

Does anybody have any tried and true ways to make IE6 or IE7 repaint a particular DOM element in these cases (without obviously popping an alert)? It works flawlessly in Firefox. I know IE is a steaming pile, but just wondering if anyone has had any success with a hack that works here.

Thursday, June 19, 2008