asynchronous - Parse javascript query inside a loop -


so quite new javascript , unsure how go solving issue. know query asynchronous cannot execute inside loop not know how go this.

here calling query list of users. there loop go through each user, second query gets executed each user , uses users username part of class name. have suggestions should do?

var query = new parse.query(user);                 query.find({                     success: function (results) {                          $(".success1").show();                         progressbar.max = results.length * 2;                          (var = 0; < results.length; i++) {                             var object = results[i];                             var predictions = parse.object.extend("predictions" + object.get("username"));                              var query2 = new parse.query(predictions);                             query2.equalto("matchweekid", weeknum.value);                                  query2.find({ 

this code not run. query2.find runs once loop has been finished.


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -