AJAX
Basics
Data
DOM
Effects
Events
Forms
jQuery UI
Plug Ins
Traversing
The jQuery ajaxComplete()
method specifies a function to be run when an AJAX request
completes....regardless...if the request was successful.
The example below is designed NOT to work (bad file name) but the complete method will be executed regardless.
autoComplete()
is invoked only if there is an ajax call.
$(document).ready(function ()
{
const ShowComplete = () =>
{
$("#ajax-content").html("AJAX request **completed** even though it was not successful.");
};
$("#ajax-content").load("ajax-sample-foo.txt");
$(document).ajaxComplete(function ()
{
ShowComplete();
});
});