I am trying to get the ajax request progress through the following code:
var xhr = new XMLHttpRequest(); xhr.addEventListener('progress', function(event) { console.log(event.loaded / event.total); }, false); xhr.addEventListener('load', function() { console.log('load'); }, false); xhr.open('get', 'test.php', true); xhr.send();
The problem is that the progress event is fired only once, right before the load event (that is, in Webkit, it seems that it does not work under Gecko).
Am I doing something wrong or just not being supported properly?
source share