title: How to append data for each div separately
body: <p>Simple but I dont know how to do it. I am trying to append data for each div separately $. Each function is looping and assigning whole data to the same div.
  These are my two div.</p>
  
  <pre><code>     &lt;div class="div1"&gt;
                      &lt;div class="div2"&gt;
           // whole javascript code is here
                  &lt;/div&gt;
           &lt;/div&gt;
  </code></pre>
  
  <p>The whole code is something like this:</p>
  
  <pre><code>   &lt;script type="text/javascript"&gt;
            $(document).ready(function () {
                $.getJSON("/Post/GetPosts", null, function(data)
                {
                 htmlResultData="&lt;br /&gt; " + "Users received from server: " + "&lt;br /&gt;";
                 $.each(data, function (i, item)
                 {
                htmlResultData += item.PostedByName + "&lt;img src='" + item.PostedByAvatar + "'height='100' width='100'/&gt; ";
                 });
                  $(".div2").empty().append(htmlResultData);
              //however, i have tried to return false here but still same result
                 return false;
               });
             });
  </code></pre>
  
  <p>Div1 contains outer CSS for that particular div2. I want to generate multiple div2 for each data returned from the server. I have tried using return false but still same result. Please tell me how to do it.</p>