在Ajax请求成功完成时,附加要执行的函数 $( ".trigger" ).on( "click", function() { $( ".result" ).load( "ajax/test.html" );});$( document ).ajaxSuccess(function( event, xhr, settings ) { if ( settings.url == "ajax/test.html"
$( ".trigger" ).on( "click", function() { $( ".result" ).load( "ajax/test.html" ); }); $( document ).ajaxSuccess(function( event, xhr, settings ) { if ( settings.url == "ajax/test.html" ) { $( ".log" ).text( "Triggered ajaxSuccess handler. The Ajax response was: " + xhr.responseText ); } });