Posted in Internet Explorer 7, Windows Defender, Windows Server 2008, Windows Server 2008 - HowTo, Windows Server 2008 - Tips | No Comments »
A script may not run as expected in Windows Internet Explorer when you open an HTML page and the HTML page contains an element that has injected HTML code
| Article ID |
: |
948550 |
| Last Review |
: |
March 4, 2008 |
| Revision |
: |
1.0 |
SYMPTOMS
When you use Windows Internet Explorer to open an HTML Web page and the Web page contains an element that has injected HTML code, the script may not run as expected.This problem occurs if the following conditions are true:
| • |
The element is not included in the markup tree. |
| • |
Active scripting is disabled in the Internet zone. |
| • |
The site is added to the Trusted Sites zone. |
Back to the top
CAUSE
This issue occurs because Internet Explorer sets the security of an element as about:blank if the following conditions are true:
| • |
A Web page inserts code into the element. |
| • |
The element is not included in the markup tree. |
Back to the top
RESOLUTION
To resolve this issue, make sure that the element is included in the markup tree. When you do this, the element obtains the security from the current page. To do this, call the
innerHTML property before you call the element in the script.
Back to the top
MORE INFORMATION
The following code example illustrates how to include the element inside the markup tree.
treeDiv = srcDoc.createElement(DIV);treeDiv.id = treeDiv;treeDiv.className = treeDiv;treeDiv.style.pixelTop = 0;scrollDiv.appendChild(treeDiv);treeDiv.onresize = treeResize;treeDiv.innerHTML = loadTree(treeXML);
Back to the top
APPLIES TO
| • |
Windows Internet Explorer 7 |
| • |
Microsoft Internet Explorer 6.0 |
| • |
Microsoft Internet Explorer 5.5 |
| • |
Microsoft Internet Explorer 5.0 |
Back to the top
Microsoft Knowledge Base Article
This article contents is Microsoft Copyrighted material.
Microsoft Corporation. All rights reserved. Terms of Use | Trademarks
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.

Leave a Reply