What is the ajaxSuccess() method in jQuery?
Overview
In jQuery, the ajaxSuccess() method is used to specify a function that runs when an AJAX request gets completed successfully.
Syntax
$(document).ajaxSuccess(function(event, xhr, options));
Parameters
This method accepts a mandatory function as an argument, which accepts the following parameters:
event—the event objectxhr—the instance ofXMLHttpRequestobjectoptions—the options used in the AJAX request
Example
Explanation
We click Get Product Data and make an AJAX request to get product details:
https://reqres.in/api/products
The ajaxSuccess() method is invoked when the AJAX request completes successfully.