views:

1206

answers:

4

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.

+3  A: 

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.

Greg
+1  A: 

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)
Alagu
+1  A: 

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.

fearphage
+1  A: 

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

Robert.K