I\'m a bit confused on how to use the ajax .done() function. I\'m working on validating a form to check if a user exists in database and though ajax would be the best approach (
Success: It will return the XHR success status, eg: 200
Done: Once XHR get success then it will complete the and return with a return data
Try below code
$.ajax({
type: "POST",
url: Url,
data: dataParameter,
async: true,
success: function(results, textStatus) {
debugger;
console.log("success : " + results);
},
error: function(xhr, status, error)
{
console.log("error : " + xhr.responseText);
}
}).done(function(results) {
debugger;
console.log("done : " + results);
});