Wednesday, October 10, 2007

Internet Explorer cannot open the Internet site - Operation aborted


I was affected by this issue and it took me some time to figure out what's the reason of it (in my case it was quite tricky). Generally - the reasons causing this error in IE are quite known. (Here are some for your reference :)

In my case it was a completely different story - it was caused by few IE DOM implementation bugs. Consider you have code on the IE client side that parses page body nodes and then removes them:

while (body && body.hasChildNodes()) {
var node = body.firstChild;
// ... app logic
body.removeChild(node);
}


Now consider that body content is created by Response.Write() on the server side (I write down some context in <p>...</p> paragraphs sections).
My application was working as a blaze, but occasionally I was getting "Internet Explorer cannot open the Internet site - Operation aborted" in IE. In Firefox it was never happen.
After some research I narrowed down the reason to the fact that body context is created by Response.Write and then I catched up what the problem was - it was related to the fact that on the server side I was writing body nodes in 4 steps:
1) ‘<p>’
2) app-specific content
3) ‘</p>’
4) Flush() output.

So - sometimes on the client side the code was running while paragraph weren't fully formed (e.g. only starting <p> was written).
In this case body.hasChildNodes() still returns true (IE bug #1) and body.removeChild(node) will cause "operation aborted" (IE bug #2).
As I noted - it's IE-specific and not happens in other browsers.

Fortunatelly - I had Response() bufferring turned off at the server side - o/w above problem would still happen, but with much lower frequency, making it very difficult to track it down.
The solution, as you may guess, is to write whole node at once on the server side...

1 comment:

ZeeBigTourist said...

I've had this error message (and went nuts), but I cracked (not my head) the code, just in time.


This is what I did --> http://zeebigtourist.blogspot.com/2009/06/internet-explorer-cannot-open-internet.html



Thanks for all the helpful info.


ZeeBigTourist