jQuery ajaxSuccess()Method

jQuery AJAX 方法jQuery AJAX Methods

Example

When an AJAX request completes successfully, trigger an alert box:

$(document).ajaxSuccess(function(){ alert("AJAX request completed"); });

Try it yourself »

Definition and Usage

The ajaxSuccess() method specifies the function to run when an AJAX request completes successfully.

Note:As of jQuery version 1.8, this method is only attached to the document.


Syntax

$(document).ajaxSuccess(function(event,xhr,options))

Parameter Description
function(event,xhr,options) Required. Specifies the function to run if the request succeeds.
Extra parameters:
  • event- Contains the event object
  • xhr- Contains the XMLHttpRequest object
  • options- Contains the options used in the AJAX request


实例

More Examples

Using the options parameter
How to use the options parameter to restrict the function to use AJAX requests for a specific file.


jQuery AJAX 方法jQuery AJAX Methods

Other Extensions