html标签object和embed,html5 – iframe,embed和object元素之间的区别

< iframe>

The iframe element represents a nested browsing context. 07000

主要用于包括来自其他域或子域的资源,但也可用于包括来自同一域的内容。 < iframe>的强项是嵌入代码是“活的”并且可以与父文档通信。

< embed>

在HTML 5标准化之前,它是一个非标准的标签,这是所有主要的浏览器实现的。 HTML 5之前的行为可能有所不同…

The embed element provides an integration point for an external (typically non-HTML) application or interactive content. (07001)

用于嵌入浏览器插件的内容。例外情况是SVG和HTML,根据标准处理不同。

有关嵌入内容可以做什么以及无法做什么的详细信息取决于所讨论的浏览器插件。但对于SVG,您可以从父级访问嵌入的SVG文档,如:

svg = document.getElementById("parent_id").getSVGDocument();

从嵌入式SVG或HTML文档内部,您可以访问父级:

parent = window.parent.document;

对于嵌入式HTML,没有办法从父级(我已经找到)获取嵌入式文档。

< object>

The element can represent an external resource,which,depending on the type of the resource,will either be treated as an image,as a nested browsing context,or as an external resource to be processed by a plugin. (07002)

结论

除非你嵌入SVG或静态的东西,你可能最好使用< iframe&gt ;.要包括SVG使用embed(如果我记得正确< object>不会让你脚本)。老实说,我不知道你为什么会使用< object>除非对于旧的浏览器或闪存(我不使用)。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值