Archive for IE hacks

Drip: memory leak detector for IE

I found out about Drip through John Resig’s Secrets of JavaScript Libraries panel at SXSW this year. Unfortunately I couldn’t attend his panel, but the presentation document seems like a good read.

Anyway, Drip is a memory leak detector application for Internet Explorer. It basically runs IE within the application itself, and analyzes the memory usage for any leaks. Seems really really useful, and just by playing with it for a few minutes I already found a couple of pieces of code to fix.

IE8 performance improvements

Steve Souders wrote some thoughts on performance improvements happening in IE8, with their change to support 6 parallel downloads from the same hostname at the same time.

Previously IE would download and execute the JavaScript files in sequence, to make sure that no changes to the DOM would happen in the wrong order. Now IE8 downloads all script files in parallel (up to the new limit of 6 downloads at a time), and then will execute them in sequence.

According to Steve, there’s a big difference for some sites. Facebook for instance takes a 80% performance gain while using IE8 and having an empty cache.

By the way, I didn’t know Steve had a blog — Subscribed.

Changing image src attribute reliably in Internet Explorer

I just spent quite a bit of time debugging this silly problem on, where the document control buttons were not working under Internet Explorer. Since it might be useful to somebody else, I’m going to document the solution here.

The problem was that the document browsing control buttons, which look like the following:

<img src="/blog/browse_controls.png" />

They were implemented by doing something similar to this:

<a href="javascript:void(null);" onClick="javascript:openNextPage();" class="nextpage"><img src="/images/nextpagebutton.gif" alt="Next page" /></a>

And then inside the openNextPage function, I swap the image by changing the src attribute of the image tag. Pretty standard, and works perfectly under Firefox.

Long story short, the javascript:void(null); bit is what is breaking Internet Explorer (IE6 on this case). Changing the XHTML code to look like the following fixes the problem completely for me:

<a href="javascript:openNextPage();" class="nextpage"><img src="/images/nextpagebutton.gif" alt="Next page" /></a>

I found out the culprit by (obviously) searching Google for a long time, and then finding this thread on