ashleysheridan.co.uk

Blog

Posting on comments has temporarily been suspended.

Explorer Loading Bug

Twice this week have I come across this, being completely oblivious to it in the past, but IE has a strange bug that makes itself known when you are using Javascript to update a page that has not quite finished loading. This happened on two different sites, one developed by myself, the other by a colleague at work.

I'll give the work one as an example. I'd just quickly wrote a couple of text highlighting functions in Javascript that were to be called on a search results page for a new site. The actual call to the function was put into the footer of the page, just before the last few bytes of HTML. This worked just fine in Firefox and it's more standards compliant neighbors, but IE flat-out bombed out. The page appeared to load, but was then inturrupted by a dialogue message saying the page could not be loaded. Well, I was darned sure I could see it, but nevermind. I click on the 'OK' button, and the whole page blanks out, as if I'd navigated to an empty page.

This took a little while to diagnose, as we hadn't tested the site in IE for a little while, so it could have been one of many updates. Having eventually discovered the culprit, I had the notion of moving the call to the function to the onload handler of the page. Problem solved, and still none the wiser why IE threw such a fit. I can only surmise that it was having difficulty loading and changing the page at the same time. I would have said it taught me to place code that changes the page into the aforementioned event handler, but I still managed to trip myself up again less then a few days later when I was playing with sIFR. I think I'll remember my lesson now, but it's easier said than done!

Keep Up To Date

  • Follow me on Twitter
  • Add me on LinkedIn
  • Subscribe to my RSS feed
Works on all browsers!