$.ajax({
type : 'POST',
url : 'user.php',
data : $('form').serialize(),
success : function (response, status, xhr) {
alert('请求成功后');
},
complete : function () {
alert('请求完成后,不管是否失败成功');
},
beforeSend : function () {
alert('发送请求之前执行');
},
error : function () {
alert('请求失败后');
}
});