title: AJAX request progress percentage log
body: <p>I read content from
  <a href="http://www.dave-bond.com/blog/2010/01/JQuery-ajax-progress-HMTL5/" rel="nofollow">http://www.dave-bond.com/blog/2010/01/JQuery-ajax-progress-HMTL5/</a> and i try make that ajax progress bar on my own site, but in console i have only xhr response when php script is full completed.</p>
  
  <p>My part of JS code:</p>
  
  <pre><code>    $('#userSaveData').on('click', function(e){
              e.preventDefault();
          var $form = $(this).closest('form');
          var route = $form.attr('action');
          var form_data = $form.serializeObject();
          $.ajax({
          xhr: function()
          {
                  var xhr = new window.XMLHttpRequest();
                  //Upload progress
                  xhr.upload.addEventListener("progress", function(evt){
                      if (evt.lengthComputable) {
                          var percentComplete = evt.loaded / evt.total;
                          //Do something with upload progress
                          console.log(percentComplete);
                      }
                  }, false);
                  //Download progress
                  xhr.addEventListener("progress", function(evt){
                      if (evt.lengthComputable) {
                          var percentComplete = evt.loaded / evt.total;
                          //Do something with download progress
                          console.log(percentComplete);
                      }
                  }, false);
              return xhr;
          },
          type: 'post',
          url: route,//url to my script below
          data: form_data, //some data, not used in script below
          success: function(){
              console.log('completed');
           }
          });
      return false;
     });
  </code></pre>
  
  <p>For example, part of my test php script is:</p>
  
  <pre><code>&lt;?php
      usleep(10000000);
      echo true;
  ?&gt;
  </code></pre>
  
  <p>My current console log first show 1, and then after about 10sec console.log write 'completed'</p>
  
  <p>Simply, i want while ajax request is in progress (php usleep time is about 10sec) display in console percentage of ajax reqest (is that possible?).</p>
  
  <p>Please help.</p>