var xhr = new plus.net.XMLHttpRequest();
xhr.onreadystatechange = function() {
if (xhr.readyState === 4) {
if (xhr.status == 200) {
waiting.close();
if (xhr.responseText != "") {
console.log(xhr.responseText);
var data = JSON.parse(xhr.responseText);
if (data.code == 200) {
//收不到返回值,以前可以
mul.alert("修改成功!");
mui.back();
} else {
mui.alert(data.msg);
}
}
}
}
}
xhr.open("POST", arg);
xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
xhr.send(postdatastr);
wanggc
- 发布:2015-06-15 09:25
- 更新:2015-06-15 09:25
- 阅读:1423
plus.net.XMLHttpRequest() 发送post请求,返回值不实时
分类:HBuilder
0 个回复