title: Parse.com wait until async is done trouble
body: <p>I am new to the javascript part of parse.com and I am trying to first find some records and then do something else but have no luck so far :-/</p>
  
  <p>Here is what i am trying to do:</p>
  
  <pre><code>var Comments = Parse.Object.extend("GroupWallComments");
  var query1 = new Parse.Query(Comments);
  query1.equalTo("story", story.id);
  query1.find().then(function(results2){
  
      for (var i = 0; i &lt; results2.length; i++) {
              var comment = results2[i];
  
              $("#story"+i+"").append('&lt;div class="comment media"&gt;&lt;div class="media-left"&gt;&lt;a class="avatar avatar-lg" href="javascript:void(0)"&gt;&lt;img src="global/portraits/6.jpg" alt="..."&gt;&lt;/a&gt;&lt;/div&gt;'+
          '&lt;div class="comment-body media-body"&gt;&lt;a class="comment-author" href="javascript:void(0)"&gt;'+comment.get("username")+'&lt;/a&gt;'+
          '&lt;div class="comment-meta"&gt;&lt;span class="date"&gt;Just now&lt;/span&gt;&lt;/div&gt;'+
          '&lt;div class="comment-content"&gt;&lt;p&gt;'+comment.get("comment")+'&lt;/p&gt;&lt;/div&gt;'+
          '&lt;/div&gt;&lt;/div&gt;');
  
      }
  
  }).then(function(commentForm){
      $("#story"+i+"").append('&lt;form class="comment-reply" action="#" method="post"&gt;'+
              '&lt;div class="form-group"&gt;&lt;textarea class="form-control" rows="5" placeholder="Comment here"&gt;&lt;/textarea&gt;&lt;/div&gt;'+
              '&lt;div class="form-group"&gt;&lt;button type="submit" class="btn btn-primary"&gt;Comment&lt;/button&gt;&lt;/div&gt;'+
              '&lt;/form&gt;');
  });
  </code></pre>
  
  <p>Now, the first part comes out as it should, but the last "then" do not seem to work :-/ I do not get the form at the end of the comments. I can not see what i am doing wrong.</p>
  
  <p>Any help is appreciated and thanks in advance :-)  </p>