网站制作学习网经验与学习→正文: because its MIME type ('text/plain') is not executable, andstrict MIM
字体:

because its MIME type ('text/plain') is not executable, andstrict MIM

经验与学习 2024/1/9 20:14:59  点击:不统计

转载%77%77%77请%2E%66%6F%72%61%73%70%2E%63%6E注明

在本地运行127.0.0.1 网页时,因为引入.js 代码,结果出现了,页面出现
Refused to execute script from '<URL>' because its MIME type ('text/plain') is not executable, andstrict MIME type checking is enabled.
 
具体引入js 出现:
Refused to execute script from "http://127.0.0.1:8338/static/app.js' because its MIME 127.0.0.1/:1type ('text/plain') is not executable, and strict MIME type checking is enabled.
 
页面代码如下:
<html lang="en">
  <head>
  <title> Title </title>
  <script src="/static/vendors~app.js"></script><script src="/static/app.js"></script>
  </head>
 ....
 
 后来更改后
 <script type="text/javascript" src="/static/vendors~app.js"></script><script type="text/javascript" src="/static/app.js"></script>
 仍然不行,网络搜索了一下找到原因,
 
 如果windows 安装了 vs2012 vs2015等软件,它会给注册表新建一个.js 解析类型的值为 text/plain'
 
 解决方法:
 运行 cmd,regedit 修改注册表
 “计算机/HKEY CLASSES ROOT/.js”
 找到 找到Content Type键,将原始值  text/plain 更换为  text/javascript
 然后重启浏览器 即可
 
 解决方案原来连接:https://blog.csdn.net/ForeverCjl/article/details/17139729

原载于:本文原载于www.forasp.cn

·上一篇:windows 查找任务关闭任务 >>    ·下一篇:windows WSL 访问宿主机Windows服务 >>
推荐文章
最新文章