Tutorials References Exercises Bootcamps Videos Menu
Sign Up Create Website Get Certified Upgrade

jQuery ajaxComplete() Method

❮ jQuery AJAX Methods


Show a "loading" indicator image while an AJAX request is going on:

  $("#wait").css("display", "block");

  $("#wait").css("display", "none");
Try it Yourself »

Definition and Usage

The ajaxComplete() method specifies a function to be run when an AJAX request completes.

Note: As of jQuery version 1.8, this method should only be attached to document.

Unlike ajaxSuccess(), functions specified with the ajaxComplete() method will run when the request is completed, even it is not successful.



Parameter Description
function(event,xhr,options) Required. Specifies the function to run when the request completes
Additional parameters:
  • event - contains the event object
  • xhr - contains the XMLHttpRequest object
  • options - contains the options used in the AJAX request

❮ jQuery AJAX Methods