fangsystem 发表于 2013-1-29 11:50:29

用jquery实现ajax设置请求超时处理

jQuery.ajax({
   type: "POST",
   url: urls, //请求url
   timeout: 60000,//(毫秒)
   complete : function(xml){
   if(xml.status == 200){
returnSuccess(xml);
}
   },
   error: function(xml,error){ //超时处理
   //alert(xml.responseText);
   //alert(xml.responseXml);
   //alert(error);
//if(error == "timeout"){
returnError(xml);
//}
   }
});
页: [1]
查看完整版本: 用jquery实现ajax设置请求超时处理