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 translations Article translations
Article ID: 948550 - View products that this article applies to.
Expand all | Collapse all

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.

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.

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.

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);

Properties

Article ID: 948550 - Last Review: March 4, 2008 - Revision: 1.0
APPLIES TO
  • Windows Internet Explorer 7
  • Microsoft Internet Explorer 6.0
  • Microsoft Internet Explorer 5.5
  • Microsoft Internet Explorer 5.0
Keywords: 
kbcode kbwebbrowser kbtshoot kbprb KB948550

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com