Refused to execute script from 'http://localhost:8080/login.html'

Refused to execute script from ‘http://localhost:8080/login.html‘ Refused to execute script from 'http://localhost:8080/login.html' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.异常处理【已解决】 阅读详情

这两天学习spring security,碰到了一个坑,我给记录一下.
浏览器控制报错信息
Refused to execute script from ‘http://localhost:8080/login.html’ because its MIME type (‘text/html’) is not executable, and strict MIME type checking is enabled.
login.html:18 Uncaught ReferenceError: $ is not defined
at login.html:18
html页面
在这里插入图片描述
由于我把该页面放在public文件夹下而不是templates下,所以这里的thymeleaf模板引擎在访问该页面的时候th:是不起作用的,所以这里引入js路径的是src而不是th:src。访问该页面时组件的点击事件不起作用。控制台报错如下
在这里插入图片描述
在这里我的静态资源路径已经放行
在这里插入图片描述
但是引入JQ仍然是错误的,排查了好久,发现是因为我引入的路径有问题,路径确实被拦截了,因为在spingboot中静态资源默认路径是在static下的所有文件和文件夹。所以我们在写路径时就不需要在写/static/,而我上面写的路径是src="…/static/js/jquery-3.4.1.min.js",这样访问静态资源security会拦截,
因此静态资源引入我们只要学src="/js/jquery-3.4.1.min.js"就可以了

在这里插入图片描述
改完之后访问就没有问题了,事件也起作用了。
在这里插入图片描述

Trae Solo移动端SOLO开发实战:48小时跑通真机验证流 移动端开发本质是端到端的用户交互验证,其核心在于网络可达性、真机环境适配与轻量闭环验证。随着个体开发者工作流兴起,本地化AI编程环境如Trae正成为快速构建可演示原型的关键工具。本文聚焦‘SOLO模式’这一典型场景,解析如何绕过传统全栈依赖,通过局域网服务暴露、Mock接口驱动、DPR响应式字体、微信调试代理等关键技术,实现扫码登录→状态管理→页面跳转→数据渲染的完整链路。内容覆盖iOS/Android真机联调、Taro多端一致性、H5体积压缩等高频工程痛点,为独立开发者提供可复用的移动端最小可行验证方案。 阅读详情

相关推荐

feko金属球远场RCS双站

feko金属球远场RCS双站

a264672的博客 6910

Refused to execute script from '....js' because its MIME type ('text/html') is not executable...

问题描述 解决过程 总结 问题描述 在整合 Spring Boot、Spring Security、Thymeleaf 的练习中,对页面进行调试时,发现如下错误提示: Refused to execute script from ‘http://localhost:8080/codelib-springsecurity-sample-web/js/ie10-viewpo...

小赞的技术园子 13万+

STM32F407+LAN8720网口不通?别慌,手把手教你用CubeMX和HAL库搞定RMII配置与调试

本文详细介绍了STM32F407与LAN8720网口不通的全面排查与解决方法,涵盖硬件检查、CubeMX配置、PHY芯片初始化和LWIP协议栈优化。通过RMII接口配置、时钟树设置和PHY芯片调试,帮助开发者快速定位并解决网络连接问题,提升嵌入式网络开发效率。

weixin_30457551的博客 506

Refused to execute script from 'http://localhost:8080/login' because its MIME type ('text/html') is

前端报错Refused to execute script from 'http://localhost:8080/login' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled login.js报错 但是排查问题貌似没有问题 关于后台权限 ...

weixin_42767642的博客 1万+

Gromacs实战:从蛋白质-小分子对接到分子动力学模拟全流程解析

本文详细解析了使用Gromacs进行蛋白质-小分子对接和分子动力学模拟的全流程,包括文件准备、拓扑生成、复合物构建、溶剂化处理、能量最小化及平衡模拟等关键步骤。通过实战案例,帮助研究者验证药物分子与靶标蛋白的结合稳定性,提升分子动力学模拟的效率和准确性。

weixin_29216353的博客 380

zynq-7000学习笔记(八)——USB摄像头图像采集

PC平台:WINDOWS 10 64位 Xilinx设计开发套件:Xilinx_vivado_sdk_2015.4 开发板:Zed Board USB摄像头:罗技 C270(720P) linux源码:2016_R1 一、配置linux,支持UVC       如果是中星微的ZC3XX系列的芯片,则要进到GSPCA把ZC3XX的驱动选上

luotong86的专栏 1万+

Refused to execute script from ‘;because its MIME type (‘text/html’) is not executable解决的一2021-03-27

Refused to execute script from ';because its MIME type (‘text/html’) is not executable解决的一种情况 这个问题纯粹是偶然发生。 在调试Django过程中,如果发现之前的好好的HMTL页面,突然无法再响应按钮的动作,赶紧到chrome内看HTML代码运行故障情况,结果发现,所有的JS文件都无法运行,然后提示: Refused to execute script from ';because its MIME type (‘

ReuterK的博客 7808

告别Qweb!用ReportBro在Odoo 13-19版本中5步搞定动态报表

本文介绍了如何在Odoo 13-19版本中使用ReportBro替代Qweb快速实现动态报表设计。通过5步集成指南,包括环境准备、前端集成、后端服务搭建等,展示了ReportBro在可视化设计、即时预览和多格式输出(PDF/XLSX)方面的优势,显著提升开发效率和报表灵活性。

mac99的博客 799

解决Refused to execute script from ‘http://127.0.0.1:8004/login‘ because its MIME type (‘text/html‘) i

当浏览器在加载脚本时出现警告"Refused to execute script"时,通常是由于错误的MIME类型导致的。有几种解决方法可以解决这个问题,包括检查服务器配置、设置HTTP响应头和使用CDN。通过采取适当的措施,你可以确保脚本加载正常,避免出现该警告。

牛肉胡辣汤 1万+

BRAM在图像处理缓存中的实现:完整示例解析

深入讲解如何利用BRAM高效实现图像处理中的数据缓存,结合实际案例解析BRAM的应用优势与设计细节,提升系统性能。

weixin_29443363的博客 333

【文本分析学习】Anaconda+pytorch虚拟环境下的pycharm文本分析(含分词、词性标注、词形归一化、停用词、文本情感分析、词频、文本相似度,附数据代码) NLTK

文本分析学习之 Anadconda+pytorch虚拟环境下的pycharm文本分析(含分词、词性标注、词形归一化、停用词、文本情感分析、词频、文本相似度,附数据代码)

littlexmj的博客 2331

Spring Security 中 Refused to execute script from ‘https://localhost:xxxx/xx.html‘ because its MIME t

Spring Security 中 Refused to apply style from '<URL>' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.

qq_37354060的博客 1716

Claude Code 错误解决方案 API Error: 前缀通用错误

本文分析了Claude Code与Anthropic API通信时出现的通用错误处理问题。当API返回未分类错误时,系统会直接显示"API Error: "前缀的原始错误信息。通过错误链路追踪发现,这是由于未匹配特定错误类型时触发了通用兜底处理逻辑。文章提供了三种解决方案:查看具体错误内容、启用调试日志以及提交问题反馈,并建议用户关注错误码、使用/compact命令处理上下文超限问题。最后强调这些未分类错误是预期行为,用户应通过错误消息中的线索自行排查或反馈开发者。

多媒体编程、网络编程、系统编程、网络安全编程、驱动编程 1346

Refused to execute script from ‘http://localhost:8080/login‘ because its MIME type (‘text/html‘) is

最近在学习springsecurity 的创建了动态页面,但是在控件台提示 Refused to execute script from 'http://localhost:8080/login' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled. 前端应用的代码 <head> <title>Spring Security Ex

qq_38345598的博客 3605

OV9734 DATASHEET,完整规格书

OV9734完整规格书,包括电气参数,尺寸规格,寄存器配置表等

汉书HE8,好用的汇编代码编写工具

汉书HE8,好用的汇编代码编写工具早期编写汇编代码所用功能强大

Refused to execute script from ‘‘ because its MIME type (‘text/html‘) is not executable, and strict

Refused to execute script from 'http://localhost:8080/style.js?v=1.1' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled. 造成这个报错的情况有很多,比如服务器配置错误、缓存问题、代码错误、应用部署问题等等 这篇文章是在前端项目运行时产生的问题,原因就是我在vue.config.js中设置了静态资源

qq_68155756的博客 1万+

TMS_WebGMaps_1.9.8.0_Full_Source

TMS_WebGMaps_1.9.8.0_Full_Source 全源码 delphi cbuilder

项目排坑---Spring security to execute script from ‘http://localhost:8080/login.html‘

这两天复习自己的项目发现了一个bug,重置密码里有个刷新验证码的功能突然刷新不了了,按F12调试发现出现Refused to execute script from ‘http://localhost:8080/login.html’ because its MIME type (‘text/html’) is not executable, and strict MIME type checking is enabled.login.html。

gangxuec的博客 243

廖雪峰Python教程[完整版]

廖雪峰的python教程整理的,已经排好版了,而且还是完整的,适合小白

cesium 打包环境 浅析

今天遇到一个打包的问题折腾了我很长时间,在rollup处理js文件之间的引用关系时,对路径的大小写是敏感的,例如"../FrameBuffer.js"与"../Framebuffer.js"是不同的,需要特别注意。 大概说一下npm命令的执行过程,npm是基于nodejs的一个批处理文件npm.bat,其内部类似 "%dp0%\node.exe" npm.js 是通过将js脚本传递给node.exe执行的,我们通常执行的命令"node.exe npm.js run...

tianyapai的专栏 1650

Refused to execute script from ‘http://localhost:3000/js/base.js‘ because its MIME type (‘text/html‘

原因:public 目录本来就是静态目录来的,打包的时候默认会把public的东西都复制到dist/public中。执行命令 npm install "copy-webpack-plugin": "^5.1.1"写完整的路径,/public/js/base.js。再次执行 npm run dev,启动项目试试。并在webpack.config.js文件配置。

weixin_38331749的博客 1238

Refused to execute script from because its MIME type (‘text/html‘) is not executable, and strict MIM

摘要

sb547014384的博客 2139

vsCode运行vue项目显示Refused to execute script from ‘http://127.0.0.1:5500/lib/vue.js‘

解决 Refused to execute script from 'http://127.0.0.1:5500/lib/vue.js'

Chris__Feng的博客 2378

Refused to execute script from ‘http://localhost:8080/src/23-namespace/a.js‘ because its MIME type (

Refused to execute script from 'http://localhost:8080/src/23-namespace/a.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled. 怎么解决

mango660的博客 719

Refused to execute script from 'http://127.0.0.1:8004/login' because its MIME type ('text/html') ...

Refused to execute script from 'http://127.0.0.1:8004/login' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled. Refused to execute sc...

AI天才研究院 1万+

解决chrome浏览器跨域请求报Refused to execute script from

          在最近一次项目中有一个接口是JSONP接口,也就是允许跨域访问,在firefox中是可以正常访问,chrome中确报如下错   Refused to execute script from 'xxxxxxxxxx' because its MIME type ('text/html') is not executable, and strict MIME type ch...

bewithme的专栏 1万+
上一篇: HashSet
下一篇: 使用MutationObserver监听元素class属性改变时执行的操作
小码林marlin
博客等级 码龄9年 30粉丝 29原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值