Resolve the problem that AJAX return status 200 does not call success

Time:2019-5-22

Today, when I was doing a demo, I found that the status of Ajax was 200, but I didn’t implement the correct method.

SpringMVC + ajax +jquery

When Spring MVC returned to String with the annotation @ResponseBody, the browser displayed 200 status codes, and the response header was in JSON format. The format Ajax did not consider it json, so it always executed the wrong method.

Then remove dataType= “json” and OK!

The above article solves the problem that AJAX return status 200 does not call success, which is all the content shared by the editor. I hope to give you a reference, and I hope you can support developpaer more.

Recommended Today

Translation | JavaScript beyond browser restrictions

Translator: An Dong (web front end development engineer of Hujiang)Please indicate the author and source of this article.Original address: http://developer.telerik.com/… The technological world is developing, and JavaScript is also developing at the same time. In its first few years in the software world, JavaScript never wanted to get involved in services applications, mobile applications and […]