Microsoft KB Archive/927917

From BetaArchive Wiki
< Microsoft KB Archive
Revision as of 09:26, 21 July 2020 by X010 (talk | contribs) (Text replacement - ">" to ">")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Article ID: 927917

Article Last Modified on 10/27/2007



APPLIES TO

  • Microsoft Internet Explorer 5.5
  • Microsoft Internet Explorer 6.0
  • Windows Internet Explorer 7



SYMPTOMS

When you visit a Web page or you interact with a Web application, you receive an Internet Explorer dialog box that contains the following error message:

Internet Explorer cannot open the Internet site http://<Web site>.com. Operation aborted.

CAUSE

This problem occurs because a child container HTML element contains script code that tries to modify the parent container element of the child container. The script code tries to modify the parent container element by using either the innerHTML method or the appendChild method.

WORKAROUND

To work around this problem, write script blocks that only modify closed containers or that only modify the script's immediate container element. To do this, you can use a placeholder to close the target container, or you can move the script block into the container that you want to modify.

Example 1

In this example, the DIV element is a child container element. The SCRIPT block inside the DIV element tries to modify the BODY element. The BODY element is the unclosed parent container of the DIV element.

<html>
  <body>
      <div>
                  <script type="text/Javascript">
                    document.body.innerHTML+="sample text";
                  </script>
      </div>
  </body>
</html>

To resolve this problem, use one of the following methods.

Method 1: Modify the parent element

Move the SCRIPT block into the scope of the BODY element. This is the container that the script is trying to modify.

<html>
  <body>
      <div>
      </div>
      <script type="text/Javascript">
           document.body.innerHTML+="sample text";
      </script>
  </body>
</html>

Method 2: Modify a closed container element

Add a closed container as a placeholder in the parent container element. Then, modify the new closed container with a script block.

<html>
  <body>
      <div id="targetContainer">
      </div>
      <div>
      <script type="text/Javascript">
           document.getElementById('targetContainer').innerHTML+="sample text";
      </script>
      </div>
  </body>
</html>

Example 2

In this example, a SCRIPT block that is inside a deeply nested TD container element tries to modify a parent container BODY element by using the appendChild method.

<html>
  <body>
      <table>
                <tr>
                         <td>
                                 <script type="text/Javascript">
                                                  var d = document.createElement('div');
                                                  document.body.appendChild(d);
                                 </script>
                         </td>
                 </tr>
      </table>
  </body>
 </html>

To resolve this problem, move the SCRIPT block into the BODY element.

 <html>
  <body>
      <table>
                <tr>
                        <td>
                       </td>
                 </tr>
      </table>
      <script type="text/Javascript">
                                  var d = document.createElement('div');
                                  document.body.appendChild(d);
                     </script>
  </body>
 </html>

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed in the "Applies to" section.

MORE INFORMATION

For example, this problem may occur if a DIV element is a child container in a BODY element, and a SCRIPT block in the DIV element tries to modify the BODY element that is a parent container for the DIV element. This is a bug in the Internet Explorer parser.

Keywords: kberrmsg kbtshoot kbbug kbcode KB927917