My code has the following function:
$.post($form.attr('action'), $form.serializeArray())
.done(function (json) {
}
From what I understand from jQuery docs, this is a shortcut. What I would like to do is change so that it allows me to execute some function that executes on successful execution, and some function that executes on error. Is it possible to do this? All I see is .done?
$.ajax({
url: target,
dataType: 'json',
type: 'POST',
data: data,
success: function(data, textStatus, XMLHttpRequest) { },
error: function(XMLHttpRequest, textStatus, errorThrown) { }
source
share