I have a working a ajax call thats get data form a file and load in to database.
$.ajax({
xhr: function() {
// Download progress
xhr.addEventListener("progress", function(evt){
if (evt.lengthComputable) {
var percentComplete = (evt.loaded / evt.total)*100;
$("#LoadStatus").html("Procent: "+percentComplete+" av "+evt.total+"%");
}
}, false);
return xhr;
},
type: 'POST',
url: purl,
data: formdata,
success: function(data){
// Do something success-ish
$("#LoadStatus").html("ALL Availibe data is now in DB");
}
});
the function that i call with the API updates a counter of how many rows that have been insterted. YOu have anyideas how i can do this the best way?