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

Analysis of laravel based on redis queue

Last modified: May 10, 2019 15:04:22 Reference link Use the knowledge that laravel queue has to understand Laravel queue document Redis Chinese document Article environment Laravel 5.5 Queue Redis Why use queues The purpose of using queues is generally: Asynchronous execution Error retry Explain: Asynchronous execution: some code execution is time-consuming. In order to improve […]