Jul 30
Internet Explorer Friendly Error Pages
In the past I’ve read hundreds of articles about the failings, “features” and related idiosyncrasies of Internet Explorer but until last week I hadn’t heard of this one. When we tested the site in Internet Explorer we found that every page would load correctly and then, right at the last second, change to the standard 404 error page saying that the page could not be found. If the user had turned off the “friendly” error pages in Internet Explorer the site performed fine.
I don’t know about you, but I wasn’t too sure where to start.
After thinking for a while, I checked the headers being sent by the server, they were all fine and dandy. Next I started ripping code haphazardly from the page until the quirk didn’t exhibit itself any more. Turned out that the whole problem was located in the stylesheet. To confirm this, I emptied the stylesheet and reloaded the page, it was fine.
After chopping back and chopping back and then slowly adding back in, I discovered that our designer had used the csshover.htc behaviour file to allow :hover on all elements in Internet Explorer 6. He has used this before successfully many, many times so I knew that something else was amiss.
Anyway, 5 minutes later I discovered that is was being referenced incorrectly from the stylesheet, the URL was given relative to the main page[1]. The 404 was being generated when the onload event fired for the page when it couldn’t find the .htc to include.
Moral of the story, check your damn code people. A missing forward slash in a stylesheet turned into a 45-minute debugging session.
Another one to chalk up as to why Internet Explorer should die.
[1] For whatever reason, I think IE was looking for the behaviour in the folder relative to the CSS (which is correct), not finding it and then looking relative to the document it was included from. I say this because the front page didn’t give the 404 whereas every other page did.

Alex Taylor is a web developer living and working in 



