Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

jquery
ajax
communitycreator

What is ajaxComplete() method in jQuery?

Shubham Singh Kshatriya

In jQuery, the ajaxComplete() method is used to specify a function that runs when an AJAX request completes.

Syntax

$(document).ajaxComplete(function(event, xhr, options));

Parameters

This method accepts a mandatory function that accepts the following parameters.

  • event: The event object
  • xhr: The instance of XMLHttpRequest object
  • options: The options used in AJAX request.

Example

The following tab will show the ajaxComplete() function in action:

Press the “Get Product Data” button to see it in action

Console
Example of ajaxComplete() method.

Explanation

We have made a GET request on https://reqres.in/api/products to fetch some product details.

When the AJAX request completes, the ajaxComplete() method will be invoked.

RELATED TAGS

jquery
ajax
communitycreator

CONTRIBUTOR

Shubham Singh Kshatriya
RELATED COURSES

View all Courses

Keep Exploring