admin管理员组文章数量:1022553
I have created a simple spring boot application for my View is loading jquery but not executing it.Details are below: My Project structure
[
My Controller
My JqueryCode
My HTML page that import jQuery
Chrome Inspector shows jquery is loaded fine
But still my jQuery code is not running, and if I try running it directly from console., is says jQuery is not Defined
Guys please tell me what am i doing wrong / or missing.
I have created a simple spring boot application for my View is loading jquery but not executing it.Details are below: My Project structure
[
My Controller
My JqueryCode
My HTML page that import jQuery
Chrome Inspector shows jquery is loaded fine
But still my jQuery code is not running, and if I try running it directly from console., is says jQuery is not Defined
Guys please tell me what am i doing wrong / or missing.
Share Improve this question asked Jun 29, 2016 at 11:33 mohit sharmamohit sharma 1,08010 silver badges20 bronze badges 3- Could you post the generated HTML? Also, does this occur on other browsers? It looks like the JS resources all loaded fine, so is there anything in materialize.js that may be delaying the document from being ready and hence the exeution of the $(document).ready()? – Finbarr O'B Commented Jun 29, 2016 at 12:26
- @FinbarrO'Brien generated HTML? do you want html page source – mohit sharma Commented Jun 30, 2016 at 5:11
- @FinbarrO'Brien I also checked by removing materialize.js. Still same problem? Even if i don't import jquery lib and import my jquery code, it doesn't say $/jQuery not defined. It simply doesn't execute any js file or library – mohit sharma Commented Jun 30, 2016 at 5:14
1 Answer
Reset to default 4If 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/assignments/media-types/media-types.xhtml
I have created a simple spring boot application for my View is loading jquery but not executing it.Details are below: My Project structure
[
My Controller
My JqueryCode
My HTML page that import jQuery
Chrome Inspector shows jquery is loaded fine
But still my jQuery code is not running, and if I try running it directly from console., is says jQuery is not Defined
Guys please tell me what am i doing wrong / or missing.
I have created a simple spring boot application for my View is loading jquery but not executing it.Details are below: My Project structure
[
My Controller
My JqueryCode
My HTML page that import jQuery
Chrome Inspector shows jquery is loaded fine
But still my jQuery code is not running, and if I try running it directly from console., is says jQuery is not Defined
Guys please tell me what am i doing wrong / or missing.
Share Improve this question asked Jun 29, 2016 at 11:33 mohit sharmamohit sharma 1,08010 silver badges20 bronze badges 3- Could you post the generated HTML? Also, does this occur on other browsers? It looks like the JS resources all loaded fine, so is there anything in materialize.js that may be delaying the document from being ready and hence the exeution of the $(document).ready()? – Finbarr O'B Commented Jun 29, 2016 at 12:26
- @FinbarrO'Brien generated HTML? do you want html page source – mohit sharma Commented Jun 30, 2016 at 5:11
- @FinbarrO'Brien I also checked by removing materialize.js. Still same problem? Even if i don't import jquery lib and import my jquery code, it doesn't say $/jQuery not defined. It simply doesn't execute any js file or library – mohit sharma Commented Jun 30, 2016 at 5:14
1 Answer
Reset to default 4If 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/assignments/media-types/media-types.xhtml
本文标签: javascriptSpring boot and Thymeleaf application jquery is loading but not executingStack Overflow
版权声明:本文标题:javascript - Spring boot and Thymeleaf application: jquery is loading but not executing - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745561310a2156177.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论