$.ajax({
    type: 'post',
    url: '/url',
    data: 'payload',
    dataType: 'json',
    success: function(resp) {
        alert('success');
    },
    error: function(resp) {
        alert('error');
    }
});