IE9, Iframes, DOCTYPES, and You

do we still need a special code for IE 9?

IE is always special…

It’s showing the page in “Compatability View,” which essentially drops back to what IE7 did. The tip-off (took me a long time to realize this) is the empty vertical scrollbar at the far right (not the scrollbar in the iframe itself).
In IE9, take a look at Tools, Compatability View Settings, and see if my domain is listed there.

Old, old thread, but I’ve been paying attention to this issue for the last 2+ years. IE10 still had the bug in it - the DOCTYPE of the content of the iframe was ignored. But IE11, mirabile dictu, appears to get it right. Try my demo page in IE11, and I think you’ll see that the embedded page renders correctly. With IE9 or IE10, it doesn’t.

http://misterneutron.com/iframe/

Hi EarlyOut,
I wonder if it is a real bug of IE; anyway it is a firm html-error! *)
(and there are [U]more[/U], the html-validator is shouting)

In the page of nbc the <meta http-equiv=“X-UA-Compatible” content=“IE=5”> is in the wrong place: before the <html> tag, instead of inside the <head>.

If you move the <meta> inside the <head>, IE10 is doing well:

If you delete the whole <meta> completely, and the document starts with <html> (without doctype), IE10 can handle it also:

According to Browsershots, [U]IE9 does the same[/U].

Some more info about IE10 and quirks mode: [U]msdn.microsoft.com/en-us/library/ie/hh869300%28v=vs.85%29.aspx[/U]


*) Or maybe nbc did it deliberately, against iframe-robbery. :wink:

It’s very tough to sort out. The MS documentation was very clear that the DOCTYPE of the parent page would be applied to the child page in the iframe, regardless of the explicit DOCTYPE of the child. Perhaps having no DOCTYPE in the child somehow avoids the problem.

I’m just happy that this is something I can file away in the “ignore unless it comes roaring back” file. IE9 is dying fast (in my site stats, it’s accounting for fewer visitors than IE8, in fact), and if IE11 is getting pumped out as a regular update, IE10 will vanish equally quickly.

Here’s the wonderful diagram I recall encountering when I first ran into this issue. If this doesn’t tell you what’s Wrong in Redmond©, I don’t know what will. :wink:

http://ie.microsoft.com/testdrive/ieblog/2010/Jun/16_IEsCompatibilityFeaturesforSiteDevelopers_1.svg

And yet, for all that, they don’t really define what they mean by a page that “indicates” quirks mode. “Indicates” how, exactly?

Yes the mind boggles :slight_smile: