I 've been engaged in this thing for a long time, recording it down, saving the trouble
1. return format: return "{\" msg \ ": \" "+ message +" \ ", \" msg2 \": \ "" + message2 + "\"} ", which seems to have to be returned. I use string. format, but I can't even write it down.
2. the return value is inexplicably cached. I modified the return value and returned the previous value. I was almost tortured by this problem and found that I could only recycle the IIS application pool.
3. To call a method, you must use eval to convert it. In addition, I can search for. net3.5 and 2.0 to convert it. I use 3.5.
$. Ajax ({
Type: "post ",
Url: "/Service/post. asmx/BindPersonal ",
Data :"{}",
Datatype: "json ",
ContentType: "application/json; charset = UTF-8 ",
Success: function (result ){
Var realobj = eval ('+ result + ')');
Alert (realobj. msg );
Alert (realobj. msg2 );
},
Error: function (x, e ){
Alert (x. responseText );
}
});