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);
}
});
0 个回复