为什么jQTouch作为application/x-javascript

发布于 2024-10-01 13:30:36 字数 110 浏览 2 评论 0原文

我一直想知道为什么任何 jQTouch 文件都使用 mime 类型“application/x-javascript”而不是“text/javascript”。我想知道这是否有特殊原因,或者只是为了准确性?

I've always wondered why any jQTouch files are served with the mime type "application/x-javascript" as opposed to "text/javascript". Is there a particular reason for this I wonder, or is it just for accuracy's sake?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

灰色世界里的红玫瑰 2024-10-08 13:30:36

这似乎消除了混乱:

一直以来人们对
javascript 的官方 MIME 类型。
虽然服务器似乎大多使用
遵循 Apache 规则:AddType
application/x-javascript
*.js 作者
声称它是 text/javascript
*
SCRIPT 元素的 TYPE 属性
(如果他们声明的话)。那有
多种原因。 首先,
HTML 规范建议
文本/javascript 和
application/x-javascript 不是
Internet Explorer 支持。笔记
仅当 IE 不支持它时
是 TYPE 属性的值,
服务器发送的内容似乎没有
事情。

而且它会变得更好。虽然
HTML 阵营很高兴地提到
他们的 .js 充当
application/x-javascript 使用
text/javascript 作为 TYPE 的值
人们正在使用的 SVG 属性
text/ecmascript。
再说一遍,这是
因为 SVG 规范建议
它。

也许,在不久的将来,这将
当选秀结束时一切都结束了
脚本媒体类型 (01) 成为
RFC。最终它会指定两个
媒体类型。 (目前列出
四种。)一种用于 javascript,另一种用于
ECMAScript。从理论上来说
我希望应用程序/javascript
和 application/ecmascript 将
生存到最后。然而,
文本/javascript 和文本/ecmascript
在这方面可能更有用
目前的实施和
规格。

This seems to clear the confusion:

There has always been confusion on the
official MIME type of javascript.
While servers mostly seem to use the
following Apache rule: AddType
application/x-javascript
*.js authors
claim it is text/javascript
* in the
TYPE attribute of the SCRIPT element
(if they declare it). That has
multiple reasons. First of all, the
HTML specification suggests
text/javascript and
application/x-javascript is not
supported by Internet Explorer. Note
that IE does not support it only if it
is the value of the TYPE attribute,
what the server sends does not seem to
matter.

And it gets even better. While the
HTML camp is happily referring to
their .js served as
application/x-javascript using
text/javascript as value for the TYPE
attribute SVG people are using
text/ecmascript.
And again, this is
because the SVG specification suggests
it.

Perhaps, in the near future this will
all be over when the draft of
Scripting Media Types (01) becomes a
RFC. Eventually it will specify two
media types. (Currently it lists
four.) One for javascript and one for
ECMAScript. From a theoretical point
of view I hope application/javascript
and application/ecmascript will
survive to the end. However,
text/javascript and text/ecmascript
are probably more useful with regard
to current implementations and
specifications.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文