title: When the ajax call is fully completed?
body: <p>when any ajax call is done by clients , Clients  uploads data to server(HTTP  request) and then receive data from server(HTTP Response), when the data is received totally by clients,  the ajax request is consider successful and  success callback function is executed ,</p>
  <p>But when i try to track ,this data transfer between client and server , by using <code>xhr</code> in <code>$.ajax</code> call</p>
  <pre><code>xhr: function(){
     
      var xhr = $.ajaxSettings.xhr() ;
     
      xhr.upload.onprogress = function(e){console.log('upload progress',e.loaded/e.total*100) } ;
       xhr.onprogress =  function(e){console.log('total downloaded',e.loaded)}
      return xhr ;
  </code></pre>
  <p>In this ajax request , server is sending 277695 bytes file , But
  The data is not completely downloaded, still it says  XHR finished loading , Why after some part is downloaded first , And XHR request is become complerted ,</p>
  <p><a href="https://i.stack.imgur.com/Rn2O2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Rn2O2.png" alt="enter image description here" /></a></p>
  <p>We can see here server a is sending a file of length 277695 bytes ,  But only the 7946 bytes downloaded , and it says xhr finished loading , I was expecting , all file (277695 bytes)should be downloaded before XHR finsihed loading. So can someone explain why only some part of file is downloaded first ?</p>
  <h2>UPDATE</h2>
  <p>And i also want to ask when the success call back function is executed, because it will be executed when whole result(response) received from server . So when the success callback function will be executed ? after total download is 7946, OR after the whole data  downloaded , i.e total downloaded is 277695</p>