.ajaxSuccess()The .ajaxSuccess() method in jQuery is used to attach a function to be executed whenever an Ajax request completes successfully.
.ajaxSuccess() syntax.ajaxSuccess(handler)
handler is a function to be invoked.
.ajaxSuccess() exampleShow a message when an Ajax request completes successfully.
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 ).ajaxSuccess(function() {
$( "#msg" ).append( "<p>Triggered ajaxSuccess handler</p>" );
});
