How to use ajaxComplete() Method in JQuery AJAX

In this article, I will explain use of ajaxComplete () Method in JQuery AJAX.
  • 6229

JQuery AJAX ajaxComplete() Method

  • ajaxComplete() is implement as a method of jquery object.

  • ajaxComplete() add a function to be executed when the AJAX request completes.

  • After ajaxComplete() success and error callbacks are executed.

  • ajaxComplete() method is a AJAX Event.



function(event,xhr,options) The function is run when the request completes.

  • event - Event parameter contains the event object.

  • xhr - xhr parameter contains the XMLHttpRequest object.

  • options - option parameter contains the options used in the AJAX request.



The following example show the use of ajaxComplete() method.


<!DOCTYPE html>



<script type="text/javascript" src="jquery.js"></script>

<script type="text/javascript">

    $(document).ready(function () {

        $("#txt").ajaxStart(function () {

            $("#wait").css("display", "block");


        $("#txt").ajaxComplete(function () {

            $("#wait").css("display", "none");


        $("button").click(function () {







<div id="txt"><h2>ajaxComplete() method example</h2></div>

<button>click for change article text</button>

<div id="wait" style="display:none;width:69px;height:89px;border:1px solid black;position:absolute;top:50%;left:50%;padding:2px;"><img src='WaitingBig.gif' width="64" height="64" /><br />Loading..</div>





You may also want to read these related articles Click here

Ask Your Question 

Got a programming related question? You may want to post your question here

Programming Answers here

© 2020 DotNetHeaven. All rights reserved.