• <small id='xZ8n7'></small><noframes id='xZ8n7'>

    1. <legend id='xZ8n7'><style id='xZ8n7'><dir id='xZ8n7'><q id='xZ8n7'></q></dir></style></legend><tfoot id='xZ8n7'></tfoot>

        <i id='xZ8n7'><tr id='xZ8n7'><dt id='xZ8n7'><q id='xZ8n7'><span id='xZ8n7'><b id='xZ8n7'><form id='xZ8n7'><ins id='xZ8n7'></ins><ul id='xZ8n7'></ul><sub id='xZ8n7'></sub></form><legend id='xZ8n7'></legend><bdo id='xZ8n7'><pre id='xZ8n7'><center id='xZ8n7'></center></pre></bdo></b><th id='xZ8n7'></th></span></q></dt></tr></i><div id='xZ8n7'><tfoot id='xZ8n7'></tfoot><dl id='xZ8n7'><fieldset id='xZ8n7'></fieldset></dl></div>
        • <bdo id='xZ8n7'></bdo><ul id='xZ8n7'></ul>
      1. application/x-javascript 和 text/javascript 内容类型之间的区别

        Difference between application/x-javascript and text/javascript content types(application/x-javascript 和 text/javascript 内容类型之间的区别)

            <small id='3RksM'></small><noframes id='3RksM'>

            • <i id='3RksM'><tr id='3RksM'><dt id='3RksM'><q id='3RksM'><span id='3RksM'><b id='3RksM'><form id='3RksM'><ins id='3RksM'></ins><ul id='3RksM'></ul><sub id='3RksM'></sub></form><legend id='3RksM'></legend><bdo id='3RksM'><pre id='3RksM'><center id='3RksM'></center></pre></bdo></b><th id='3RksM'></th></span></q></dt></tr></i><div id='3RksM'><tfoot id='3RksM'></tfoot><dl id='3RksM'><fieldset id='3RksM'></fieldset></dl></div>
                  <tbody id='3RksM'></tbody>
                <tfoot id='3RksM'></tfoot>
                • <bdo id='3RksM'></bdo><ul id='3RksM'></ul>
                  <legend id='3RksM'><style id='3RksM'><dir id='3RksM'><q id='3RksM'></q></dir></style></legend>

                  本文介绍了application/x-javascript 和 text/javascript 内容类型之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  这些标头有什么区别?

                  Content-Type: application/javascript
                  Content-Type: application/x-javascript
                  Content-Type: text/javascript
                  

                  哪个最好,为什么?

                  请不要说它们是相同的 - 如果它们相同,就不会有三个.我知道两者都有效 - 但我想知道它们的区别.

                  Please do not say they are identical - if they were identical there would not have been three of them. I know both work - but I would like to know the difference.

                  推荐答案

                  text/javascript 已过时,application/x-javascript 是实验性的(因此 >x- 前缀)在 application/javascript 可以标准化之前的过渡期.

                  text/javascript is obsolete, and application/x-javascript was experimental (hence the x- prefix) for a transitional period until application/javascript could be standardised.

                  您应该使用 application/javascript.这在 RFC.

                  就浏览器而言,没有区别(至少在 HTTP 标头中).这只是一个更改,以便 text/*application/* MIME 类型组在可能的情况下具有一致的含义.(text/* MIME 类型旨在用于人类可读的内容,JavaScript 并非旨在直接向人类传达意义).

                  As far a browsers are concerned, there is no difference (at least in HTTP headers). This was just a change so that the text/* and application/* MIME type groups had a consistent meaning where possible. (text/* MIME types are intended for human readable content, JavaScript is not designed to directly convey meaning to humans).

                  请注意,在脚本元素的 type 属性中使用 application/javascript 会导致脚本在某些较旧的浏览器中被忽略(因为是未知语言).要么继续使用 text/javascript ,要么完全省略该属性(这在 HTML 5 中是允许的).

                  Note that using application/javascript in the type attribute of a script element will cause the script to be ignored (as being in an unknown language) in some older browsers. Either continue to use text/javascript there or omit the attribute entirely (which is permitted in HTML 5).

                  这在 HTTP 标头中不是问题,因为浏览器普遍(据我所知)要么完全忽略脚本的 HTTP 内容类型,要么足够现代以识别 application/javascript.

                  This isn't a problem in HTTP headers as browsers universally (as far as I'm aware) either ignore the HTTP content-type of scripts entirely, or are modern enough to recognise application/javascript.

                  这篇关于application/x-javascript 和 text/javascript 内容类型之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  quot;Status Code:200 OK (from ServiceWorker)quot; in Chrome Network DevTools?(“状态码:200 OK(来自 ServiceWorker)在 Chrome 网络开发工具中?)
                  How to set a header for a HTTP GET request, and trigger file download?(如何为 HTTP GET 请求设置标头并触发文件下载?)
                  Adding custom HTTP headers using JavaScript(使用 JavaScript 添加自定义 HTTP 标头)
                  What is quot;X-Content-Type-Options=nosniffquot;?(什么是“X-Content-Type-Options=nosniff?)
                  SQL Query DocumentDB in Azure Functions by an integer not working(通过整数在 Azure Functions 中 SQL 查询 DocumentDB 不起作用)
                  Azure Functions [JavaScript / Node.js] - HTTP call, good practices(Azure Functions [JavaScript/Node.js] - HTTP 调用,良好实践)

                  <small id='yLlRu'></small><noframes id='yLlRu'>

                    <i id='yLlRu'><tr id='yLlRu'><dt id='yLlRu'><q id='yLlRu'><span id='yLlRu'><b id='yLlRu'><form id='yLlRu'><ins id='yLlRu'></ins><ul id='yLlRu'></ul><sub id='yLlRu'></sub></form><legend id='yLlRu'></legend><bdo id='yLlRu'><pre id='yLlRu'><center id='yLlRu'></center></pre></bdo></b><th id='yLlRu'></th></span></q></dt></tr></i><div id='yLlRu'><tfoot id='yLlRu'></tfoot><dl id='yLlRu'><fieldset id='yLlRu'></fieldset></dl></div>
                    • <bdo id='yLlRu'></bdo><ul id='yLlRu'></ul>

                      <tfoot id='yLlRu'></tfoot>
                        <tbody id='yLlRu'></tbody>

                          <legend id='yLlRu'><style id='yLlRu'><dir id='yLlRu'><q id='yLlRu'></q></dir></style></legend>