为什么YouTube在嵌入式视频的iframe中放入type =属性? [英] Why did YouTube put a type= attribute in iframe for embedded video?

查看:156
本文介绍了为什么YouTube在嵌入式视频的iframe中放入type =属性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当前往YouTube时,它会提供嵌入代码,例如

 < iframe title =YouTube video player
class =youtube-playertype =text / htmlwidth =640height =385
src =http://www.youtube.com/embed/QRvVzaQ6i8A?rel= 0\" >
< / iframe>

请注意,

  type =text / html

不是有效的html。 iframe标签没有这样的属性。



任何人都可以解释为什么谷歌这样做?我猜这是出于一些实际原因,但我无法猜测出什么。



PS你可以通过在这里获得嵌入代码 http://www.youtube.com/watch?v=QRvVzaQ6i8A

解决方案

我猜这是Google本身的错误。我怀疑有一个错误。它不是HTML4的一部分,也不是HTML5的一部分。您可以放心地忽略它并将其删除。

关于类型属性主题:对象元素上的类型符合但已过时。它从未真正被浏览器用来猜测URI的内容。


When going to YouTube, it gives a embed code such as

<iframe title="YouTube video player"
class="youtube-player" type="text/html" width="640" height="385"
src="http://www.youtube.com/embed/QRvVzaQ6i8A?rel=0">
</iframe>

Note that the

type="text/html"

is not valid html. There's no such attribute for iframe tag.

could anyone explain why google put that? I guess it's for some practical reason, but i couldn't guess what.

PS you can get the embed code by going here http://www.youtube.com/watch?v=QRvVzaQ6i8A

解决方案

I guess it is a mistake from Google itself. I suspect a mistake. It was not part of HTML4, and it is not part of HTML5. You can safely ignore it and remove it.

on the type attribute topic: The type on the object element is conforming but obsolete. It has never been really used by browsers to guess the content of the URI served.

这篇关于为什么YouTube在嵌入式视频的iframe中放入type =属性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆