Springboot之后台代码无误,Ajax一直进入error方法


1.后台使用@RequestController 

2.Ajax限制dataType为 JSON

3.后台代码无误,正常增删查改,但是前端一直进入error

4.在error中添加打印语句

 console.log("1 异步调用返回失败,XMLHttpResponse.readyState:"+XMLHttpResponse.readyState);
                console.log("2 异步调用返回失败,XMLHttpResponse.status:"+XMLHttpResponse.status);
                console.log("3 异步调用返回失败,textStatus:"+textStatus);
                console.log("4 异步调用返回失败,errorThrown:"+errorThrown);

  打印:...Parse error

5.百度:格式错误   

6.将datatype改为 "text" , 问题解决.

7.OVER


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM