Related: What's the point of Content-Script-Type and Content-Style-Type.
我想知道开发者不使用的主要原因是什么
-
<meta http-equiv="content-script-type" content="text/javascript" />
和 -
<meta http-equiv="content-style-type" content="text/css" />
在他们的网络项目中。 (顺便说一句,我也不是。)
免于申报使用过的 type
在 <script>
的每个实例上和 <style>
,它似乎没有任何缺点。然而,事实上,我从未在野外见过它们中的任何一只。依赖这些 <meta>
时是否需要考虑任何因素?标签?
最佳答案
根据 W3C ,http-equiv 值“content-style-type”和“content-script-type”属性是 unknown
用于 HTML5 元标记!此外,当 HTML5 页面具有此类标记时,W3C 验证器会抛出以下错误:
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">
所以基本上我们应该避免它们。
关于html - 为什么 <META HTTP-EQUIV ="Content-Script-Type"...> 大部分未被使用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6320084/