chrome出现MIME type is not executable

来源:互联网 发布:mac pcb软件 编辑:程序博客网 时间:2024/05/05 17:46

chrome出现MIME type is not executable

错误信息: because its MIME type ('text/plain') is not executable, and strict MIME type checking is enabled.
情景: 在一个页面动态引入github上的js文件。
问题原因:github动态加载js文件时返回content-type为text/plain,与文件类型.js不匹配,禁止加载。
问题解决:获取js文件转换成script标签可用的地址,如:“ https://raw.githubusercontent.com/* ”,然后取出第一个“.”变为:“ https://rawgithubusercontent.com/*”。
参考:https://code.google.com/p/chromium/issues/detail?id=180007
  http://webmasters.stackexchange.com/questions/50006/chrome-refused-to-execute-this-javascript-file
http://blog.sina.com.cn/s/blog_666d6ee10101eyh0.html

0 0