Problem background:
Mistakenly using <from metod= "POST" action= "/test" ></form> form
Use AJAX data in JS code to submit requests again to the background eg:url: "/test2"
Problem Error:
The background correctly returns the content of the "/test2" request, but jumps directly to the AJAX error function, viewing the error as: statustext: "Error" status:0 readystate:0
Error causes: Both form submission and AJAX data requests are used, resulting in a return failure.
Workaround:
1, use form form or use Ajax one.
2, the Internet seems to use Preventdefault () method to solve the problem, when the problem is more complex can choose this one, the specific solution to be followed by learning.
Reference Links:
http://www.justinball.com/2013/02/25/jqxhr-returning-readystate-0-and-status-0/
Http://www.w3school.com.cn/jsref/event_preventdefault.asp