Flashing Pages in IE 6

Microsoft recently released Internet Explorer 6 and this really is the most capable browser I’ve seen. For the longest time I was loyal to Netscape, but IE 4 overtook, IE 5 kept innovating, and IE 6 is the best yet. I am a bit worried about all the MS specific stuff in there, but right now I’m welcoming the innovation.

The flash…

But, I’ve been having this annoying problem.

When a page loads, there’s a temporary white screen that flashes up for a split second just before the page loads. Looks quite jarring on many sites.

From what I can see this only ever happens when the page is inside a <frameset>. If there’s lots and lots of JavaScript or CSS inline in the <head> tag of the page that is retrieved by the browser before the <body> tag it can cause this pause.

The fix…

First of all try extracting stuff into external .js and .css files. Ensure that all links to these files actually exist (the browser may spend time looking for stuff that it can’t find).

Finally, if the problem still occurs, try moving the intensive JavaScript to after the <body> tag. Be careful that no events occur before the JS that they rely on has been loaded.

Overall, get rid of the bloat incurred before the main body.