success(), Error and complete() in AJAX call

Below is a diagram illustrating the process flow: The success() (Local Event) is only called if the request was successful (no errors from the server, no errors with the data). On the other hand, the complete() (Local Event) is called regardless of if the request was successful, or not. You will always receive a complete callback, even for synchronous requests. source : 1.https://stackoverflow.com/questions/1021062/use-success-or-complete-in-ajax-call/42229704#42229704 2. https://api.jquery.com/Ajax_Events/