Why does the following throw an "Object doesn't support property or method 'importNode'"
in IE11?
Could it be my "document mode"? I am in "document mode" 7.
<!DOCTYPE html>
<html>
<head>
<script>
function go() {
var popUp = window.open('about:blank');
var node = document.createElement('div');
node.textContent = 'foo';
var importedNode = popUp.document.importNode(node, true);
popUp.document.body.appendChild(importedNode);
}
</script>
</head>
<body>
<button onclick="go()">Click Me</button>
</body>
</html>
For clarification I want the node, node
to be created by the opener window, and I am using importNode
in order to attempt to get this working in IE (it is not needed for Chrome).
importNode
was added in IE9 I think (https://msdn.microsoft.com/en-us/library/ie/gg130964%28v=vs.85%29.aspx).