I am modifying the code at night. I used the
$.ajax( {
..
dataType:'json',
...
success:function(json){
//Do not execute success
},
error:function (error){
//Always execute this error
}
});
Why is this like this? After searching on the Internet for a long time, I found that it was because I specified dataType:'json'. Once specified, the requirements for Json became very strict. At first, my json format was written like this: "{result:{ "success":"true","meg":"success"}}", but it doesn't work like this. You have to change it to like this: "{"success":true,"mesg":"success"}", if you say If it is a bool type, there is no need to add quotes. All other keys/values need to be quoted.