醒着星星
醒着星星
  • 发布:2016-08-26 16:37
  • 更新:2019-01-12 19:14
  • 阅读:1353

plus.net.XMLHttpRequest的timeout无效

分类:HTML5+
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了

2016-08-26 16:37 负责人:无 分享
已邀请:
lam

lam

设置大一点看看

raise

raise

mark

该问题目前已经被锁定, 无法添加新回复