« Free Gmail Invites Microsoft AntiSpyware: What Lurks Beneath »
Strange IE Bug
Posted January 11, 2005 – 3:10 pm by Yakov Shafranovich in ProgrammingToday I came across a VERY strange IE bug - a certain page would not work in IE6 under Windows XP SP2, while it worked fine in Opera, Mozilla and Firefox. The message shown would be as follows:
Internet Explorer cannot open the Internet site [url] Operation aborted
After more digging, I came across a post at a Microsoft Wiki:
“Operation aborted”
Apparently interacting with innerHTML and possibly using other JScript functionality causes IE to pop up “Internet Explorer cannot open the Internet site http://example.com. Operation aborted.” messages after loading a page. This is sometimes attributed to BHO mal/spyware, but I can confirm it happens with no such software installed. This bug is present in IE SP1 and IE SP2.
http://peterjanes.ca/blog/archives/2003/12/03/hulk-smash
I was having this problem trying to put some html inside a DIV tag using innerHTML and solved the problem by puting the DIV inside a TABLE.
Sample code for “Operation aborted”
This sample code will give you the “Operation aborted” error in IE6, while it works as expected in Firefox:
<table> <tr> <td> <script type="text/Javascript"> var d = document.createElement('div'); document.body.appendChild(d); </script> </td> </tr> </table>If the script part is moved outside the table it works in both IE6 and Firefox. (Emphasis added)
It seems that this problem is caused by the fact that the SCRIPT block operating on innerHTML or DOM structures is located inside a TABLE tag. I moved the SCRIPT tags outside the TABLE tag, and viola - that fixed the problem.
Peter Janes pointed out in the comments that the issue is deeper than that, it seems to be related to the timing issues with DOM rendering. I am going to leave it for now unless I see other problems, but using setTimeout or some other way of doing things is not out of the question.
Tags: dhtml, firefox, ie, javascript, microsoft, mozilla, opera —
Permalink | Trackback URL | This post has















4 Responses to “Strange IE Bug”
If only it were that simple… but I don’t use <script> anywhere but in the <head> on the Sirens site. Wound up just removing the offending code, which seems to be the safest thing since it appears to be a timing issue.
By Peter J. on Jan 11, 2005
What about using setTimeout like suggested by the MSDN team?
By netwizard on Jan 11, 2005
calling the javascript within a settimeout call worked for me.
By homer on Jan 13, 2005
this workds very well explained.
By Anonymous on Jan 14, 2005