Those. standards mode, iframes and dom manipulations

IE9 (standards mode) does not allow you to manipulate iframes in the DOM at all. If you use jQueryUI Dialog or jQuery.wrap () to wrap content that has an iframe, IE9 will explode in it. In fact, you don’t even need jQuery, a plain old JS will work fine (see below).

I would like to know what people think about it, since Microsoft says that they do it specifically to fix a memory leak .

We do not know what to do with this. Putting all of our documents that use iframes into Quirks mode seems wrong. But we do not know what the alternatives are. Any ideas? TIA.

Javascript Code Example:

<p id="after"></p> 

.. put an iframe here ...

  <script type="text/javascript"> //uncomment code below in IE9 standards mode to see error //document.getElementById("after").appendChild(document.getElementById("iframe")); </script> 
+4
source share
1 answer

After I ran into this problem, I gave in to the browser switching to quirks mode:

  Response.AddHeader("X-UA-Compatible", "IE=8"); 

Any other solutions are certainly welcome, because, like tengoal, I suspect that this is not the best option, although it works .

+3
source

Source: https://habr.com/ru/post/1346815/


All Articles