Chrome说“资源解释为脚本,但是以MIME类型text / plain传输”,什么给了? [英] Chrome says "Resource interpreted as script but transferred with MIME type text/plain.", what gives?
问题描述
lockquote
资源被解释为脚本,但是以MIME类型text / plain传输。
我检查了所有脚本标记,它们都有 MIME类型=text / javascript
。它甚至用jQuery和jQuery UI来表达。 Chrome有什么问题?
这有什么问题和解决方法?这是我必须在浏览器的选项中更改的东西,还是来自服务器,还是必须调整我的代码? 解决方案
这意味着服务器正在发送一个Javascript HTTP响应,其中包含
pre $ Content-Type:text / plain
您需要配置服务器以发送带有
$ b的JavaScript响应$ b
Content-Type:application / javascript
In FF and all, my javascript works fine. But in Chrome it gives this message:
Resource interpreted as script but transferred with MIME type text/plain.
I have checked all the script tags and they all have the MIME type="text/javascript"
. It even says so with jquery and jquery ui. What is wrong with Chrome?
What's the problem and the fix for this? Is it something I have to change in the 'options' of the browser or is it from the server, or do I have to tweak my code?
It means that the server is sending a Javascript HTTP response with
Content-Type: text/plain
You need to configure the server to send a JavaScript response with
Content-Type: application/javascript
这篇关于Chrome说“资源解释为脚本,但是以MIME类型text / plain传输”,什么给了?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!