var xhr = new plus.net.XMLHttpRequest();
xhr.responseType = "json";
xhr.onreadystatechange = function() {
switch(xhr.readyState) {
...
...
}
}
xhr.ontimeout = function(e) {
var str = "lengthComputable=" + e.lengthComputable + "loaded=" + e.loaded + ";total=" + e.total;
console.log("ontimeout: " + str);
}
xhr.timeout = 1;
xhr.open("POST","http://xxxxx.com"):
xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
xhr.send();
设置超时无效啊。
运行时,直接readyState=4了
2 个回复
lam
设置大一点看看
raise
mark