关于打开浏览器.js被阻止的解决办法
作者:互联网
网页正常打开,在执行ajax或者.js被调用时,出错,F12切出发现错误提示:
Refused to execute script from 'http://xxx.xxx.xxx.xxx/xxx.js' because its MIME type ('text/plain') is not executable, and strict MIME type checking is enabled.
方法一
Win+R =>regedit
进入注册表your computer\HKEY_LOCAL-MACHINE\SOFTWARE\Classes\.js
进入该目录将内容‘text/plain’改为‘application/javascript’
方法二
python -c "import mimetypes; print(list(mimetypes.guess_type('index.js')))"
我发现我显示的是'text/plain',果然是这个问题 然后运行下一行代码:
reg delete HKCR\.js /v "Content Type"
标签:解决办法,浏览器,text,xxx,js,MIME,plain,type 来源: https://www.cnblogs.com/vPYer/p/16574582.html