Ajax错误响应是否太晚?
Ajax函数错误响应(发生网络错误)等待1分钟。 如果有任何函数可以快速获取错误响应Ajax错误响应是否太晚?,ajax,cordova,Ajax,Cordova,Ajax函数错误响应(发生网络错误)等待1分钟。 如果有任何函数可以快速获取错误响应 var $this=$(form); $.ajax({ url: 'http://www.example.com/post.php', dataType: 'text', cache : false, crossDomain : true, type: 'post', contentTyp
var $this=$(form);
$.ajax({
url: 'http://www.example.com/post.php',
dataType: 'text',
cache : false,
crossDomain : true,
type: 'post',
contentType: 'application/x-www-form-urlencoded',
data: $this.serialize(),
async:false,
success: function( data, textStatus, jQxhr ){
alert(textStatus);
},
error: function( jqXhr, textStatus, errorThrown ){
alert(errorThrown);
}
});
return false;
这是一个
timeout
选项,可能适合您的需要:。我正在尝试超时数据已成功发布,但返回超时。