【JavaScript】解决$ is not defined问题-CSDN博客

网站介绍:文章浏览阅读2.4w次,点赞11次,收藏25次。1.问题在调试js代码的时候,发现浏览器控制台中出现报错:$ is not defined2.原因出现以上问题的原因大致有一下几种:1.没有导入jQuery的jar包2.jQuery的jar包放进了WEB-INF里,jQuery的jar包最好放在WebContent下,跟WEB-INF同级3.导入jQuery的路径名没有写对4.jQuery没有包含js3.解决方法:在js代码之前导包:<script type="text/javascript" src="/test/js_$ is not defined