jQuery Tutorial Tutorials - jQuery .ajaxStop()

jQuery .ajaxStop()

The .ajaxStop() method in jQuery is used to register a handler to be called when all Ajax requests have completed.

jQuery .ajaxStop() syntax

.ajaxStop(handler)

handler is a function to call.

jQuery .ajaxStop() example

example

HTML

<button id="ajaxReq">Ajax Request</button>
<div id="result"></div>
<div id="msg"></div>

jQuery

$( "#ajaxReq" ).click(function() {
    $( "#result" ).load( "/res/test/ajax/1.html" );
});
$( document ).ajaxStop(function() {
    $( "#msg" ).append( "<p>Triggered ajaxStop handler</p>" );
});

Try now

Date:2019-08-30 02:44:20 From:www.Lautturi.com author:Lautturi