Javier Albinarrate - LU8AJA

  • Increase font size
  • Default font size
  • Decrease font size

MSIE8 bug with Image object


On May this year, I found an issue in MSIE8 related to the Image objects which caused some trouble with our software (which runs on 3rd party websites).

The issue is so simple, that is astonishing how bad it is.

It seems that if there is a DOM object with id "Image", right before the onload event MSIE8 overwrites the standard Image object of javascript with the DOM element bearing that id.

In this URL you will find a simple setup that causes this issue:

There you will find that during the ONLOAD, Image becomes:
[object HTMLDivElement]
instead of
[object HTMLImageElement]

As you can imagine, having a div named "Image" wouldn't be so rare, and if you (like our case), don't have control over the webpage that you app loads, then you'll have to find weird solutions.

In short, this really bothers a lot!

The issue was reported on 2009-06-05 at the Microsoft Technical Community, and nobody gave a damn about it.

It seems to happen at least in MSIE8 version 8.0.6001.18702 Spanish.

Interestingly enough:

  • it may not happen with version 8.0.6001.18702 English
  • it does no affect when Image object is to be created from within a function
  • it seems to affect only when executed code is a onWhateverevent attribute of a DOM object

Hope this helps anyone with this issue to avoid frustration.

Last Updated on Thursday, 19 November 2009 00:20  

Google Translate

English French German Italian Portuguese Spanish