CodeAttest
VSTS, Oslo, INETA, ASP.NET, Debugging .NET Applications, Tips and Tricks

August 07, 2008

Operation Aborted Error in IE7

Yesterday I bumped into a strange Operation Aborted error. I really did not where to start looking for this error. I tried running the web site with first chance exceptions [1][2][3] turned on, running a script debugger and HTML validator but without any luck. Seems that the error is IE app related and you have to debug the IE process itself in order to find it. I did not want to go into that muddy waters so I run a more deeper search in google and I found the reason.

One of our third party components was generating HTML on the fly while the DOM is still being created. In short the problem is that scripts that are not direct child of BODY cannot modify the BODY element while the DOM is still being created.

You can find detailed explanation on the great Infinities Loop blog and in BUG: Error message when you visit a Web page or interact with a Web application in Internet Explorer: "Operation aborted" (KB 927917).

One possible solution is to put a setTimeout call for about 0.5s which calls your script at the time when (hopefully) DOM will be ready. I would not recommend this approach in general though.

For some reason the script which was marked with DEFER attribute, obviously was not deferred until the page is loaded. The problem was detected while running IE7.

[1] First and second chance exception handling (KB 105675)

[2] How to Stop on First Chance Exceptions - Visual Studio .NET 2003

[3] Demystifying first-chance exceptions (Part 1)

Labels: ,


# posted by Martin Kulov @ 3:34 AM




This page is powered by Blogger. Isn't yours?

 




Calendar Martin Kulov's Calendar   RSS Aggregate this blog

DevReach - The Premier Conference for Microsoft Technologies for SEE

Mobility Day 2008 Conference

DevReach - The Premier Conference for Microsoft Technologies in Bulgaria

International Association of Software Architects

SofiaDev .NET User Group

Microsoft Most Valuable Professional

View Martin Kulov's profile on LinkedIn

MSDN Event Bloggers




Recent posts




History




 
Copyright © 2004-2008 CodeAttest Ltd. All Rights Reserved.