.on( "ajaxStop", handler )Returns: jQuery
Description: Register a handler to be called when all Ajax requests have completed. This is an Ajax Event.
-
version added: 1.7.on( "ajaxStop", handler )
ajaxStop
event. For the deprecated .ajaxStop()
method, see .ajaxStop()
.
ajaxStop
event. Any and all registered ajaxStop
handlers are executed at this time. The ajaxStop
event is also triggered if the last outstanding Ajax request is cancelled by returning false within the beforeSend
callback function.
1
2
3
|
|
1
2
3
|
|
1
2
3
|
|
trigger
and the Ajax request completes, the log message is displayed.
Additional Notes:
-
As of jQuery 1.9, all the handlers for the jQuery global Ajax events, including those added with
.on( "ajaxStop", ... )
, must be attached todocument
. -
If
$.ajax()
or$.ajaxSetup()
is called with theglobal
option set tofalse
, theajaxStop
event will not fire.
Example:
1
2
3
|
|