Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
754 views
in Technique[技术] by (71.8m points)

html - Can an iframe content be rendered in standards mode when the parent is rendered in Quirks mode?

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...