Extract informations from a list inside a list.
<p>In my js I get a list 'data' that looks like that:</p>

<pre><code>data = {test: 'test', test2:'test2', test3 : buffer}
</code></pre>

<p>My 'buffer' has this form:    </p>

<pre><code>buffer =[{testa: 'testa', testb : 'testb'}, {testc: 'testc', testd : 'testd'}, {teste: 'teste', testf : 'testf'} ... ]
</code></pre>

<p>What I would like to do is for each element of the buffer, use the data it contains an do an append like this.</p>

<pre><code>$('.try').append('&lt;div&gt; &lt;p&gt; '+testa+' &lt;/p&gt; &lt;p&gt; '+testb+' &lt;/p&gt; &lt;div&gt;')
$('.try').append('&lt;div&gt; &lt;p&gt; '+testc+' &lt;/p&gt; &lt;p&gt; '+testd+' &lt;/p&gt;)
...
</code></pre>

<p>html:</p>

<pre><code>&lt;div class='try' &gt;
</code></pre>

<p>Any idea on how to do that?</p>

<p>I know I can access 'buffer' with 'data.buffer'. But then, I need to create a loop with each element of 'buffer' and then for each element of buffer, extract the data in it and create a new div...</p>

<p>Any help would be very welcome.</p>

<p>EDIT:
Here is what I tried:</p>

<pre><code>    for (var i in data.buffer) $('.try').append('&lt;div&gt; &lt;p&gt; '+i.testa' &lt;/p&gt; &lt;p&gt; '+i.testb' &lt;/p&gt; &lt;/div&gt;')
</code></pre>

<p>But it doesn't work.</p>
