日期:2014-05-16  浏览次数:20752 次

用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);
//}
   }
});