[英]Spring boot and Thymeleaf application: jquery is loading but not executing
I have created a simple spring boot application for my View is loading jquery but not executing it.Details are below: My Project structure 我为View创建了一个简单的Spring Boot应用程序,它正在加载jquery但不执行它。详细信息如下: My Project结构
[ [
My Controller 我的控制器
My JqueryCode 我的JqueryCode
My HTML page that import jQuery 我的导入jQuery的HTML页面
Chrome Inspector shows jquery is loaded fine Chrome浏览器检查器显示jQuery已正常加载
But still my jQuery code is not running, and if I try running it directly from console., is says jQuery is not Defined 但是我的jQuery代码仍然没有运行,如果我尝试直接从控制台运行它,则说jQuery未定义
Guys please tell me what am i doing wrong / or missing. 伙计们,请告诉我我在做什么错/错失。
If you change the: 如果您更改:
<script type="javascript"
to 至
<script type="application/javascript"
it should work, type='javascript' is not a defined media type according to http://www.iana.org/assignments/media-types/media-types.xhtml 它应该可以工作,根据http://www.iana.org/assignments/media-types/media-types.xhtml,type='javascript '不是已定义的媒体类型
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.