lois6b lois6b - 3 months ago 16
Javascript Question

Adapting IE8 to IE11

I have this code:

container = document.getElementById("menuContainer");

and later on:


In IE8 works but in IE11 warns me:

enter image description here

What can I do?


The recommended standard reference from the node to a document has been node.ownerDocument since DOM Level 2. According to MSDN: ownerDocument is supported since IE6. In IEs node.document was also supported until IE10.

The fix for your code would hence be:


document.write was used in the example only to demonstrate the output, not as real code, hence I'm not handling its use in this answer.