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 - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -