English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
Every time an Ajax request is successfully completed, the ajaxSuccess() method attaches a function to be called. This is an AjaxEvent.
Every time an Ajax request is successfully completed, jQuery triggers the ajaxSuccess event. At this time, all handlers registered with the ajaxSuccess() method will be executed.
Note:From jQuery 1.8Since version, this method should only be attached to the document.
$(document).ajaxSuccess(function(event, xhr, options))
Display a message when the Ajax request is successfully completed:
$(document).ajaxSuccess(function(){ $("#done").text("Ajax request completed successfully"); });Test See‹/›
Using event, xhr, and options parameters, you can get more useful output:
$(document).ajaxSuccess(function(event, xhr, options){ $("#done").append(options.url); $("#done").append(xhr.status); $("#done").append(event.type); });Test See‹/›
Parameters | Description |
---|---|
function(event, xhr, options) | Specify the function to be executed when the request is successfully completed Parameters:
|