Today we ran into a very fun error and by fun I mean stupid on the part of IE and probably because we had some fun trying to make it work. As it turns out, IE doesn’t like it when you use the lightbox script and the swfobject on the same page. I understand that this two scripts are not made to work together but the cool part is that they do work together without any problem on Firefox.
The problem is simple but it is quite annoying since it makes our website useless since IE decides to close the page giving the following error: “Internet Explorer cannot open the Internet site http://<Web site>.com. Operation aborted.” Their excuse is simple: “This problem occurs because a child container HTML element contains script code that tries to modify the parent container element of the child container. The script code tries to modify the parent container element by using either the innerHTML method or the appendChild method.” and they give a simple workaround that involves placing the script on a closed div or something of that sort which we tried with no luck.
What we ended up doing was implementing a mootools domready type function for prototype to initialize both the lightbox and the swfobject once the DOM is fully loaded. Of course this fixed the problem but, when we tested on IE7, the lightbox overlay doesn’t cover the whole screen (I think this bug is unrelated to our issue but it is still an annoying bug that happens only in IE7). So, we decided to take the overlay out so the image now appears floating in the middle of the website with no backdrop.
As we usually say here on Stupid IE: Thanks IE for making our lives a little better.