为什么< META HTTP-EQUIV =“内容脚本类型" ...>大部分未使用? [英] Why is <META HTTP-EQUIV="Content-Script-Type" ...> mostly unused?

查看:113
本文介绍了为什么< META HTTP-EQUIV =“内容脚本类型" ...>大部分未使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

相关:我想知道开发者不使用的主要原因

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.

这篇关于为什么&lt; META HTTP-EQUIV =“内容脚本类型" ...&gt;大部分未使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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