jody
jody
  • 发布:2015-06-03 09:12
  • 更新:2015-06-03 09:12
  • 阅读:2001

ajax请求设置timeout,超时后返回的type为NaN

分类:MUI

ajax请求数据,设置超时时间,在超时后返回的xhr.type为NaN,遍历xhr的键值,没有type,请问各位timeout如何判断才正确?谢谢!

        mui.ajax({   
            timeout:15000,     
            url: productServiceUrl,  
            type: "post",  
            dataType: "xml",  
            contentType: 'text/xml; charset=utf-8',  
            data: soapMessage,  
            success: Success,  
            processData: false,  
            error: function(xhr) {  
                if(xhr.type === 'timeout'){  
                    plus.nativeUI.closeWaiting();  
                    mui.toast("请求数据超时,请重试");  
                }  
                console.log(xhr.innerText + xhr.type);  
            }  
        });
2015-06-03 09:12 负责人:无 分享
已邀请:

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