Thursday 12 February 2009

SWFObject and LightBox2 - IE Errors

Today a colleague of mine had a problem whereby he was trying to use LightBox 2 in a webpage, but on that page, we received the "Internet explorer cannot open the internet site XXX Operation Aborted" message, and the page doesn't load.

After a lot of debugging, nothing was apparent, and it didn't happen in Firefox.

After reading around a bit, it seems that IE has a few issues with DOM commands, and as such, the SWFObject and Lightbox2 scripts both try to access the DOM at the same time.

So, all I did was move the SWFObject script to the foot of the page, and keep the div that it is written into in its normal place.

Sorted.