Phenomenon: Use Ajax to send a request, because backstage PHP, using Ali's text message, later return type object, see in the browser is such a return format: {msg:90,ok:ok}[1, #98978]. Ajax return value is difficult to handle. {Msg:90,ok:ok} This is the third party text message return value, cannot go away. [1, #98978] This is the return value that you want to use in the background.
If the return type is complex and simply returns a field, the callback function can be accepted with complete, Data.responsetext will return the result as String, and the string can be intercepted.
Workaround:
<span style= "White-space:pre" > </span>$.ajax ({
type: "POST",//Submit as
URL: ".) /ss.php ",//Path
async:true,
dataType:" JSON ",
data: {
" XXS ": xx,
" xx ": xx,
" xx ": xx
},// Data, which is used in JSON format for transmission
complete:function (data) {///returns the results of the corresponding processing, regardless of the success or failure of the request, will go this way
var str= data.responsetext;//will return the result to a string, at which point the background tag "#" (defined by itself, primarily to intercept the string) is the primary
if (Str.indexof ("#") >0) {
var do= Str.substr (Str.indexof ("#") +1,18);
window.location= "xx.php?xx=" +DD;
} else{
alert ("Save failed, try again later");
//ajax_end
The above is a small series for everyone to bring Ajax back to the object of the rapid resolution of the whole content, I hope that we support cloud Habitat Community ~