Let's talk about a particularly nasty IE bug which can be easily tested, but when occurs can cause developers to go rummaging through potentially hundreds of lines of code looking for a needle in a haystack. IE 5.5, 6, and 7 all fall victim to the 'Operation Aborted' error which causes a page to completely hault loading and display an error message.
This 'Operation Aborted' bug is caused, according to Microsoft, because:
“a child container HTML element contains script code that tries to modify the parent container element of the child container.”
This means that IE doesn't want to allow you to modify an element's parent if it hasnt been fully loaded. This makes sense - it would be hard to access an element that isn't yet fully loaded. I would insert a joke or two about how every other modern web browser can do this correctly; but lets just focus on a solution for those people using IE.
So, how do we solve this problem
First, lets make an example case where the error occurs due to changing innerHTML before IE is ready for it, and one where we append a childNode before IE is ready.
Second, lets try using a popular Javascript framework's domready command to initiate the insertions.
And third, lets try a basic insertion of the script following the elements which caused it.
Conclusion
Both the use of the domready command and placing the script outside of the element it was trying to access worked. This gives us three possible options for tackling this problem:
For better or worse, I've decided to turn on my new site with known problems.
Q: Why would I do this?
A: My personal site can have bugs, they give me things I can blog about how to fix.
Here is a short list of broken items, in no order, I'll be attending to in the next few days:
And here are some longer term things that need to be done:
Nevertheless, even with a large list of todos, I think the site works pretty well.
For years my co-workers have told me that I needed to start a weblog; a place where I could write down the solutions I come up with for the problems I have encountered as a web developer.
I put making that weblog as a last priority for far too long...
So, last week, when I started work on this revision of my personal website I ran into a issue where I couldn't remember how to solve a problem that I had encountered before. (Specifically, this). That was the kick that made me realize I should have made this weblog a long time ago.
I've decided to call this weblog Ramblings, because that's exactly what it will consist of. You can expect to find posts about solutions for front end web development and their root causes. Short and sweet, most of the entries will not take long to read (unless the comments on them begin to pile up).