Answer the question
In order to leave comments, you need to log in
What is the best way to display data from an ajax request?
I parse the received data in this way
getData = (data)->
productContainer = []
productProperty = []
for product, i in data
productContainer.push('<div id="product_' + i + '"></div>')
for property, value of product
productProperty.push('<div class="product__' + property + '">' + property + ' - ' + value + '</div>')
<div id="product_0">
<div class="product__prop1">prop1 - stuff</div>
<div class="product__prop2">prop2 - stuff</div>
<div class="product__prop3">prop3 - stuff</div>
<div class="product__prop4">prop4 - stuff</div>
</div>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question