IE9 (standards mode) does not allow you to manipulate iframes in the DOM at all. If you use jQueryUI Dialog, or jQuery’s .wrap() function to wrap content that happens to have an iframe in it IE9 will blow up. In fact you don’t even need jQuery, plain old JS will work just fine (see below).
I’d like to know what people think about this since Microsoft says they do this on purpose to address a memory leak.
We’re not sure what to do about this. Putting all our docs that use iframes into Quirks mode seems wrong. But we’re not sure what the alternatives are. Any ideas? TIA.
Javascript Sample Code:
<p id="after"></p>
..put iframe here…
<script type="text/javascript">
//uncomment code below in IE9 standards mode to see error
//document.getElementById("after").appendChild(document.getElementById("iframe"));
</script>
After running into this issue I’ve succumbed to putting the browser into quirks mode:
Any other solutions are definitely welcome since like tengoal I suspect this isn’t the best option even though it works.