为什么< META HTTP-EQUIV =“内容脚本类型" ...>大部分未使用? [英] Why is <META HTTP-EQUIV="Content-Script-Type" ...> mostly unused?
问题描述
I wanted to know what the main reasons are that developers don't use
<meta http-equiv="content-script-type" content="text/javascript" />
和<meta http-equiv="content-style-type" content="text/css" />
<meta http-equiv="content-script-type" content="text/javascript" />
and<meta http-equiv="content-style-type" content="text/css" />
在他们的网络项目中. (顺便说一句,我也不是.)
in their web projects. (Me neither, btw.)
省去了必须在
<script>
和<style>
的每个实例上声明使用的type
的麻烦,它似乎没有任何缺点.但是,实际上,我从未在野外看到其中之一.依靠这些<meta>
标签是否有任何考虑事项?Saving one from having to declare the used
type
on every instance of<script>
and<style>
, it does not seem to have any drawbacks. Yet, in fact, I have never seen one of them in the wild. Are there any considerations one has to take when relying on these<meta>
tags?推荐答案
根据 W3C ,http-equiv值"content-style-type"和"content-script-type"属性是HTML5元标记的
unknown
!此外,当HTML5页面具有此类标记时,W3C验证器会引发以下错误:According to W3C, http-equiv values "content-style-type" & "content-script-type" attributes are
unknown
for HTML5 meta markup! Moreover, W3C validator throws the following error when an HTML5 page has such markups:X行,Y列:元素元属性http-equiv的值Content-Script-Type值不正确.
Line X, Column Y: Bad value Content-Script-Type for attribute http-equiv on element meta.
<meta http-equiv="Content-Script-Type" content="text/javascript">
因此,从本质上讲,我们应该避免使用它们.
So essentially we are supposed to avoid them.
这篇关于为什么< META HTTP-EQUIV =“内容脚本类型" ...>大部分未使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!