像失败和完成一样发送

Any way to get beforeSend() to work like done() and fail() with $.ajax ?

$.ajax(..).beforeSend(function(){
  // do things before send
}).done(.....

You can add beforeSend: like success:. The event inside beforeSend: function works before starting AJAX. This should work

$.ajax({
    url: 'your_url',
    data: your_data,
    type:  'get', 
    dataType: 'your data type',
    success: function(data){
        //Do after success
    },
    beforeSend: function(){
        //Do before ajax starting
    },
    complete: function(data){
        //Do after completing
    }
});

Here include details.