sakthivel
sakthivel

Reputation:

"Operation aborted" error message when loading a webpage in Internet Explorer

Hi friends i design a page for my project. In that I display data from database.

The problem is that it displays the data, but then a message box appears stating:

Internet explorer cannot open the internet site 'http://localhost/....' operation aborted

Please help me to fix this problem.

Upvotes: 2

Views: 8562

Answers (4)

Robert.K
Robert.K

Reputation: 506

You can use script provided by IE Blog to investigate the problem. See: http://blogs.msdn.com/ie/archive/2009/09/03/preventing-operation-aborted-scenarios.aspx

Upvotes: 1

fearphage
fearphage

Reputation: 16958

The most common code causing this problem (KB927917) is appending to the body element from a script that is not a direct child to the body element. To put it another way , writing to the body element from grandchild nodes throws this error.

No Error

<body>
  <script type="text/javascript">
    document.body.appendChild(document.createElement('div'))
  </script>
</body>

Operation Aborted

<body>
  <div>
    <script type="text/javascript">
      document.body.appendChild(document.createElement('div'))
    </script>
  </div>
</body>

Solution

Create an element that you can write to that is closed.

<body>
  <div><!-- add content to me instead of appending to the body --></div>
  <div>
    <script type="text/javascript">
      document.getElementsByTagName('div')[0].appendChild(document.createElement('div'))
    </script>
  </div>
</div>

You can programmatically create that div as well.

Upvotes: 1

Alagu
Alagu

Reputation: 2854

This is a known bug in IE 6. There may be various reasons for IE to abort operation.

Possible reasons could be:

  1. 3rd Party plugins installed in your browser (Disable it by going to IE > Tools > Internet Options > Advanced tab > Enable 3rd party browser extension )
  2. You are modifying the DOM node even before it is created. Try modifying the DOM Node after window.onDOMReady Event.
  3. As the bug says, you may be using the SmartNav feature in aspx pages. (Which i am not aware of)

Upvotes: 1

Greg
Greg

Reputation: 321864

The "operation aborted" message often happens in IE when you're using javascript and you try to modify an element before it has finished loading.

If possible, delay running your script until onload.

Upvotes: 4

Related Questions