In jQuery, the ajaxComplete()
method is used to specify a function that runs when an AJAX request completes.
$(document).ajaxComplete(function(event, xhr, options));
This method accepts a mandatory function that accepts the following parameters.
event
: The event objectxhr
: The instance of XMLHttpRequest
objectoptions
: The options used in AJAX request.The following tab will show the ajaxComplete()
function in action:
Press the “Get Product Data” button to see it in action
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
CONTRIBUTOR
View all Courses