jquery - update div in for loop -
I have a loop that wants to update a div with the counter.
The code looks like this:
for (var i = 0; i although this is not updated.
What am I doing?
The problem is that while looping, you can only $ this.files.length Define different gaps which will do every other work forever. Try this instead:
var len = $ this.files.length; Var i = 0; Var update = setInterval (function () {$ ("Counter"). Html ('& lt; p & gt; Processing file' + len + 'of' + (i + 1) + '. & Lt; / p & Gt; '); if (++ i == lane) clear interval (update);), 1000);
Comments
Post a Comment