How to populate the page via JQuery after I have the json returned

kclinycku

New Member
Ok so i have the json object returned back from my script and I have all the data but how do I put it on the page. Here is what i have so far I have a php page which has a loop like this\[code\]<div class="main-blue"><div class="blue-items"><?php foreach ($related as $row_r) { ?><div class="item-blue"><div class="image left"><img src="http://stackoverflow.com/questions/3632645/<?php print $row_r['image'] == "" ? "css/images/blue-png2.png" : "css/images/{$row_r['image']}" ?>" alt="" />\[/code\]As you can see the Php loop is looping through the array $related which has lots of products. I have an ajax call that can change the data in this array and regenerate the page. I have the new data from a getjson call\[code\] $.getJSON('function.php?type=piz&count=5', function(data) { $(data).each(function(key, value) { console.log(value); });});\[/code\]How do i recreate the page using the new data
 
Back
Top