Can an iframe content be rendered in standards mode when the parent is rendered in Quirks mode?
Asked Answered
P

2

4

I have an html page which renders an html page in an iframe where my page adds a topbar to the whole content. Inorder to render the whole page seemless, I had to rely on quirksmode rendering of the page to display the following:(similar to the way google image results page(page u get on click of an image with a top frame)-

<table>
    <tbody>
        <tr>
            <td>
               <!-- Top bar content -->
           </td>
       </tr>
       <tr>
            <td>
                <iframe src="http://anysite.com/"/>
            </td>
       </tr>
    </tbody>
</table>

The problem here is that there are pages which donot render properly in quirks mode. So they do not come out properly in the iframe. How will I overcome this? Can I render just the iframe in standards mode while the whole page is rendered in quirks mode(which I cannot compromise) .

Is there an alternative solution?

Percussion answered 25/2, 2010 at 6:32 Comment(0)
D
3

Delayed answer... but if you use an object tag instead of an iframe tag, in IE it will change the rendering mode.

<html>
<head>
    <title>Quirks mode + iframe test</title>
</head>
<body>
    <object type="text/html" data="http://stevesspace.com/test/quirks/modern.html" style="width: 300px; height: 500px;"></object>
</body>
</html>

Unfortunately, in IE10 this doesn't work if the outer page renders in IE8 mode using

<META http-equiv=X-UA-Compatible content=IE=8>

Which I'm still searching for a solution to...

See also iframe not rendering in ie9 mode when containing page is in quirks mode

Dehisce answered 27/5, 2013 at 1:38 Comment(2)
I tried to use the OBJECT with an opposite case: parent page has IE=10 mode enabled and the page in IFRAME tried to use IE=8 mode. Nothing seems to work: child page has always the same mode than in parent page.Hoang
Which version of IE are you using? the <object> fix doesn't work for IE10 (which I imagine you're using). I still haven't found a solution for that problem - we ended up having to write a separate embed page completely for IE8.Dehisce
R
1

According to this article (http://css-tricks.com/ie-iframe-quirksmode/), a page in an iframe who's parent page is in quirks mode will also render in quirks mode.

According to the author there's nothing you can do except build your page sturdy enough to withstand the brokenness of quirks mode.

Rodgers answered 14/6, 2012 at 19:2 Comment(1)
The article on css-tricks.com proposes a trick so that the child page renders properly the same mode as the parent page, i.e. in Quirks mode. This does not really answer the question which asked to render the page in standard mode. Replacing the IFRAME tag by an OBJECT frame is a more appropriate answer.Tripalmitin

© 2022 - 2024 — McMap. All rights reserved.