$.ajax

$.ajax({
     type: "GET",
     url: url,
     dataType: "json", 
     async: false,
     success: function(json, textStatus){

     //doing

     },
     error: function (xhr, err) {            
      alert("readyState: " + xhr.readyState + "
status: " + xhr.status);            
      alert("responseText: " + xhr.responseText);        
    }
}); 
原文地址:https://www.cnblogs.com/zhuiluoyu/p/4685434.html