I am posting this question as continuation of this
Backbone Collection
collection = Backbone.Collection.extend({
url:fetchedUrl,
model:model,
parse:function(response){
return response;
}
});
source = new collection;
source.fetch({
success:function(a,b,c){
ajaxLoad(c);
var Table = new TableView({collection:source});
Table.render();
}
});
Another Function
function ajaxLoad(call){
console.log(call);
// Output : Object { success: .fetch/options.success(), parse: true, error: wrapError/options.error(), emulateHTTP: false, emulateJSON: false, xhr: Object }
console.log(call.xhr.getResponseHeader('Content-Length') + ' bytes');
//Output 420358 bytes
}
I was able to get the total file size. But i want to show the progress of loading of data. How much size is loaded.
Example :
100 bytes / 420358 bytes
200 bytes / 420358 bytes
300 bytes / 420358 bytes
400 bytes / 420358 bytes
500 bytes / 420358 bytes ....
I got the value 420358. How will i get the values of 100, 200 etc.,