jQuery ajaxComplete() Method

jQuery ajaxComplete() method to be called when Ajax requests complete. Whenever an Ajax request completes jQuery triggers the ajaxComplete event, even if it is not successful.


Here is a syntax for ajaxComplete() method

$(selector).ajaxComplete( function(event, jqXHR, options) );
Parameter Type Description
function(event, jqXHR, options) Function Required. A specifies callback function to be run when the request completes.
Additional parameters
  • event - contains standard event object
  • jqXHR - contains the XMLHttpRequest object
  • options - contains plain object used in the AJAX request


    <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 ajaxComplete() method call when click on button.

<!DOCTYPE html>
  <title>jQuery ajaxComplete() event method</title>
  <script src="jquery-latest.min.js"></script>
    $(document).ready(function() {
        $("#complate").text("Request Complete.");
  <p id="complate">Response</p>
  <button>Click here to call ajaxComplete() method</button>
  <br /><br />
  <div id="msg" style="background-color:pink;">First paragraph start here</div>

Run it...   »