ajax done fail ajaxcomplete in not a function

Method .ajaxcomplete() is deprecated in the latest version of jQuery. Use .always() method to get the response of ajax request. Which is used to get the response after the ajax request is completed.

Answers 1
  • Ajax request with .always() method

    $.ajax( ...params... )
    .always(function(jqXHR, textStatus) {
        if (textStatus != "success") {
            alert("Error: " + jqXHR.statusText); //error is always called .statusText
        } else {
            alert("Success: " + jqXHR.response); //might not always be named .response
        alert('AJAX call complete');
  • Back to code snippet queries related jquery