在請(qǐng)求時(shí)將async設(shè)置為false即可
$.ajax({
type: "post",
async: false,
url: '/test',
data: data,
success: function (data) {
alert(data);
}
});