I am trying to measure download speed with ajax call. Here is the my code
var start = new Date();
$.ajax ({
url: 'https://www.example.com/perftest/dummyFile1024',
cache: false,
success : function() {
var total = (new Date() - start)
alert(total)
},
error : function(jqxhr, status, ex) {}
})
It doesn't wait until whole file loaded. When I add async: false,
it waits for loading whole file and I am able to measure bandwidth at chrome and safari however internet explorer and firefox still works the same as async: true,
they don't wait until whole file loaded. Do you have any idea how I can manage it works for I.E. and firefox as well? Thanks.