jQuery ajaxStop() Method

jQuery ajaxStop() method to be called at the end when all AJAX requests completed.

When an Ajax request completes, jQuery checks whether there are any pending Ajax requests. If none of requests pending then jQuery triggers the ajaxStop event.


Here is a syntax for ajaxStop() method

$(selector).ajaxStop( function() );
Parameter Type Description
function() Function Required. A specifies callback function to be run when all AJAX requests completed.


    <p>Ajax is use to jQuery to open URL documents with in the documents</p>
    <br />
    <p>AJAX = Asynchronous JavaScript and XML</p>

Here, in this example ajaxStop() method call when click on button.

<!DOCTYPE html>
  <title>jQuery ajaxStop() event method</title>
  <script src="jquery-latest.min.js"></script>
    $(document).ready(function() {
      var count = 0;
        $("#start").text("Start Count: " + count );
        $("#complete").text("Complete Count: " + count );
        $("#stop").text("Stop Count: " + count );
  <p id="start">ajaxStart</p>
  <p id="complete">ajaxComplete</p>
  <p id="stop">ajaxStop</p>
  <button>Click here to call ajaxStop() method</button>
  <br /><br />
  <div id="msg" style="background-color:pink;">First paragraph start here</div>

Run it...   »