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

Popular posts from this blog

c++ - 'std::string' has no member named 'get' list[i]=user.get; -

python - how we can use ajax() in views.py in django? -

java - Instances of classes -