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

This article has been archived. It is offered "as is" and will no longer be updated.
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: 01/16/2015 17:36:44 - Revision: 1.0

Windows Internet Explorer 7, Microsoft Internet Explorer 6.0, Microsoft Internet Explorer 5.5, Microsoft Internet Explorer 5.0

  • kbnosurvey kbarchive kbcode kbwebbrowser kbtshoot kbprb KB948550
Feedback