jquery:Failed to load resource: the server responded with a status of 404 (Not Found)
2017-08-25 14:22
615 查看
做javaWeb项目中使用到jquery的$.post(url,data,function(){},"json")的时候,后台是采用注解的方式的
之前没有jquery-1.10.2.js结果js文件中没有对应的$.post()
在head里面写入
结果发现浏览器端没有相应,查看后台发现并没有进入对应的url中,然后在浏览器端QQ浏览器端,点击右键 检查
然后发现http://localhost:8080/Shorttravel/static/jquery/jquery-1.10.2.js Failed to load resource: the server responded with a status of 404 (Not Found)
然而在浏览器端打开源代码,点击/Shorttravel/static/jquery/jquery-1.10.2.js,发现能够进入到代码中,所以路径没有问题
然后查看之前做过的项目,发现并没有导入这个js文件,所以就把它注释掉了。
然后重新运行,结果又发现是http://localhost:8080/Shorttravel/static/jquery/jquery.min.js Failed to load resource: the server responded with a status of 404 (Not Found)
情况和上面的一样,文件命名存在,但是又出现404,才后知后觉的发现,应该不是这儿的问题。
检查配置文件,发现在resources文件中缺少了
$.post(url,data,function (result,statue) { alert(statue); if(statue){ alert(result.resu); } });
说明:当然我相信很对人都遇到了这种情况,出现的原因不一致,但是我想通过我的这次,我想告诉大家的是
在查看控制台之后发现并没有任何情况,别忘了试试浏览器端,查看到底是出现什么问题。
当然对于写程序的大家,遇到问题需要debug,这个过程是很痛苦的,但是项目还是得继续的,所以还是需要debug的
过程很痛苦,但是当你修改成功的时候,发现也是很幸福的。相信大家都是痛苦并幸福着的。
之前没有jquery-1.10.2.js结果js文件中没有对应的$.post()
在head里面写入
<script src="<%=contextpath%>/static/jquery/jquery.min.js"></script> <script src="<%=contextpath%>/static/jquery/jquery-1.10.2.js" type="text/javascript"></script>
结果发现浏览器端没有相应,查看后台发现并没有进入对应的url中,然后在浏览器端QQ浏览器端,点击右键 检查
然后发现http://localhost:8080/Shorttravel/static/jquery/jquery-1.10.2.js Failed to load resource: the server responded with a status of 404 (Not Found)
然而在浏览器端打开源代码,点击/Shorttravel/static/jquery/jquery-1.10.2.js,发现能够进入到代码中,所以路径没有问题
然后查看之前做过的项目,发现并没有导入这个js文件,所以就把它注释掉了。
然后重新运行,结果又发现是http://localhost:8080/Shorttravel/static/jquery/jquery.min.js Failed to load resource: the server responded with a status of 404 (Not Found)
情况和上面的一样,文件命名存在,但是又出现404,才后知后觉的发现,应该不是这儿的问题。
检查配置文件,发现在resources文件中缺少了
<context:component-scan base-package="对应的包名"></context:component-scan> 包括controllers,services和mappers
之后把对应的都写上,重新运行,发现终于运行到了对应的url当中。
相关文章推荐
- Failed to load resource: the server responded with a status of 404 (Not Found)
- 好困出来的bugFailed to load resource: the server responded with a status of 404 (Not Found)
- Failed to load resource: the server responded with a status of 404 (Not Found)
- (springmvc)页面找不到静态资源文件Failed to load resource: the server responded with a status of 404 (Not Found)
- springmvc Failed to load resource: the server responded with a status of 404 (Not Found)
- ripple Failed to load resource: the server responded with a status of 404 (Not Found)
- SrpingMVC==>Failed to load resource: the server responded with a status of 404(Not Found)
- Failed to load resource: the server responded with a status of 404
- SpringMVC+shiro项目静态资源不能访问:Failed to load resource: the server responded with a status of 404
- Failed to load resource: the server responded with a status of 404 (Not Foun
- Failed to load resource: the server responded with a status of 406 (Not Acceptable)问题的解决方案
- springmvc获取json Failed to load resource: the server responded with a status of 406 (Not Acceptable)
- Failed to load resource: the server responded with a status of 406 (Not Acceptable)
- Failed to load resource: the server responded with a status of 500 (Internal Server Error)
- Failed to load resource: the server responded with a status of 500 (Internal Server Error)
- chrome浏览器调试报错:Failed to load resource: the server responsed width a status of 404 (Not Found)…http://127.0.0.1:5099/favicon.ico
- failed to load resource the server responded with a status of 500 (internal server error)
- Failed to load resource: the server responded with a status of 400 (Bad Request)
- Spring MVC json报406错误的解决办法 Failed to load resource: the server responded with a status of 406
- Failed to load resource: the server responded with a status of 500 (Internal Server Error)