Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/kotlin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ajax错误响应是否太晚?_Ajax_Cordova - Fatal编程技术网

Ajax错误响应是否太晚?

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

Ajax函数错误响应(发生网络错误)等待1分钟。 如果有任何函数可以快速获取错误响应

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
选项,可能适合您的需要:。我正在尝试超时数据已成功发布,但返回超时。