Enter Baidu Search This problem, found that someone said a sentence
Ajax in jquery async default is True (asynchronous request), and if you want to perform another Ajax after an Ajax execution, you need to async=false it.
I handled it in Ajax.
Async:false, it turns out that submitting normal data returns is normal without errors.
| The code is as follows |
|
|
$.ajax ({
Type: "POST",
Async:false,
Url:urllink,
Data:data,
DataType: "HTML",
Success:function (msg) {
Alert (data)
},
Error:function (XMLHttpRequest, Textstatus, Errorthrown) {
alert (xmlhttprequest.status);
alert (xmlhttprequest.readystate);
alert (textstatus);
},
}); |
Finally, add one point:
Send error may have the following two, or other procedural problems, we need to be careful.
1, data: "{}", data is empty also must pass "{}"; otherwise, the return is in XML format. and prompts ParserError.