SWFObject/Internet Explorer conflict and workaround. Oh yes, and please stop using IE!

aralbalkan.com ie error

My dad, of all people, emailed me to tell me that my blog wasn't loading correctly in Internet Explorer on Windows. Thanks for letting me know, dad, you rock! Now stop using IE! :)

I was getting the following error: "Internet Explorer cannot open the Internet site . . . Operation aborted". A quick google turned up a blog post by Eoghan O'Brien that outlined the issue and why it was happening:

The problem is you can’t append to the body element from script that isn’t a direct child to the body element. It can be fixed simply by putting defer=”defer” in the script tag.

According to the W3C, the defer attribute:

When set, this boolean attribute provides a hint to the user agent that the script is not going to generate any document content (e.g., no “document.write” in javascript) and thus, the user agent can continue parsing and rendering.

This immediately made me suspect that the issue involved SWFObject and a quick test confirmed this.

The fix, as stated in Eoghan's post, was to put defer="defer" in the script tags whenever I was using SWFObject. I've only change the SWF that are currently displaying on the front page. I guess I'll have to go through and change every SWFObject in every post. What a pain. In the meanwhile, viewing older posts with Flash content in it may still kill IE (how I wish I could). Which brings me to a small request:

Dear reader, if you're using Internet Explorer at the moment, please do two things: One, exit it. And two, uninstall it. Oh yeah, you can't uninstall it because Microsoft owns your computer not you. OK, so at least don't use it. Here are some yummy alternatives: Firefox, Safari (hey, why not get a Mac while you're at it and enjoy the easy life?), and Opera.

Remember: Friends don't let friends use IE.

Comments