在创建SSM工程并尝试从前台页面加载后台JSON数据时,遇到'Failed to load resource: the server responded with a status of 404 ()'和'Uncaught ReferenceError: $ is not defined'两个错误。这两个问题的根源在于jQuery库未正确加载和Spring MVC配置不完整。解决方案包括在'springmvc-servlet.xml'文件中配置jQuery资源路径,并确保删除target目录后再运行项目,以避免缓存问题导致的错误持续存在。
摘要由CSDN通过智能技术生成
Failed to load resource: the server responded with a status of 404 ()错误和Uncaught ReferenceError: $ is not defined错误
Failed to load resource: the server responded with a status of 404 ()错误
Failed to load resource: the server responded with a status of 404 ()错误和Uncaught ReferenceError: $ is not defined错误在创建ssm工程,后台json数据传入到前台时,在前台页面引入jquery时会出现这两个错误解决方法:在springmvc-servlet.xml文件中配置<mvc:resources mapping="/js/*" location="/js/"></