Resource interpreted as Script but transferred with MIME type text/plain:

我用script做ajax跨域,请求返回的是个文本字符串,chrome提示:
Resource interpreted as Script but transferred with MIME type text/html.

(请求的是script文件,返回的却是个文本格式)

貌视chrome浏览器比较认这个格式~,去掉<!DOCTYPE html>就行了。

其他影响,有待观察

仅供参考

--------

来自前线最新的消息:

经查是chrome、ff对js里的obj.style.width赋值的宽度要带px ; 去掉<!DOCTYPE html>后chrome、ff会通融一些~

正如楼下大哥所说,那个提示只是个waring~并非error~

--------

附:

常见MIME类型设置方法:

http://apps.hi.baidu.com/share/detail/33987094

PHP里设置MIME:

<?php header('Content-type: application/x-javascript'); ?>

<?php echo 'jumUrl("http://t.qq.com/duxing")'; ?>

原文地址:https://www.cnblogs.com/soundcode/p/4624614.html