gpt4 book ai didi

html - 在对象中嵌入文本/html(而不是 iframe)

转载 作者:太空狗 更新时间:2023-10-29 13:29:30 25 4
gpt4 key购买 nike

<iframe data="/localfile.html" type="text/html" width="200" height="200"></iframe>
<iframe data="http://example.com/remotefile.html" type="text/html" width="200" height="200"></iframe>
<object data="/localfile.html" type="text/html" width="200" height="200"></object>
<object data="http://example.com/remotefile.html" type="text/html" width="200" height="200"></object>

在除 IE 之外的所有浏览器下,所有 4 个测试都有效。在 IE 6 和 7 下,最后一个失败并显示空框。是否有允许 IE 在对象中加载外部 html 的解决方法?

最佳答案

查看以下内容以获取有关如何在 IE 中使用对象的更多信息:http://aplus.rs/web-dev/insert-html-page-into-another-html-page/

这归结为 IE 与其他浏览器的预期差异。对于 IE,您必须使用 classid 属性而不是 type 属性。例如(来自上面引用的站点):

<!--[if IE]>
<object classid="clsid:25336920-03F9-11CF-8FD0-00AA00686F13" data="some.html">
<p>backup content</p>
</object>
<![endif]-->

<!--[if !IE]> <-->
<object type="text/html" data="some.html">
<p>backup content</p>
</object>
<!--> <![endif]-->

请注意,classid 特定于您尝试服务器的内容类型。

关于html - 在对象中嵌入文本/html(而不是 iframe),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/311433/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com