简体   繁体   English

Spring Boot和Thymeleaf应用程序:jquery正在加载但未执行

[英]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结构

[ [ [1]

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.

相关问题 在Spring Boot中,在单击事件Html页面重定向期间使用Jquery / Thymeleaf加载Dropdown组件中的值 - In Spring Boot ,During click event Html Page Redirect and Loading the values in Dropdown components using Jquery /Thymeleaf 将js从文件系统加载到spring boot jar应用程序中(使用thymeleaf) - load js from filesystem into spring boot jar application (with thymeleaf) Spring Boot Thymeleaf相对网址 - spring boot Thymeleaf relative urls Spring启动javascript没有执行? - Spring boot javascript not executing? jQuery加载功能未调用Spring Boot控制器替换百里香模板片段 - jquery load function not invoking spring boot controller to replace thymeleaf template fragment 在 thymeleaf 和 spring 引导中提交无重定向的星级评分,使用 jquery、Z2705A83A5A06537CCE5443 - submit star-rating without redirection in thymeleaf and spring boot, using jquery, ajax Spring boot Rest thymeleaf javascript没有返回HTML - Spring boot Rest thymeleaf javascript is not returning HTML Spring 启动和 Thymeleaf:在 Z686155AF75A60A0F36E9D80C1F7ED 中迭代 map 条目 - Spring Boot and Thymeleaf: iterating map entries in JavaScript 缓存CSS,JavaScript,Image Spring Boot(+ Thymeleaf) - Cache CSS , JavaScript , Image Spring Boot (+Thymeleaf) Javascript + Spring 引导 + Thymeleaf - 表单验证 - Javascript + Spring Boot + Thymeleaf - form validation
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM