So I have an array that’s being pulled from a json object that I’d like to display as images in a div called #practice:
["<img src ="http://domain.com/wp-content/uploads/2012/10/random04-128x84.jpg"/>",
"<img src ="http://domain.com/wp-content/uploads/2012/10/chuck_norris_random_fact_generator_6_3957_2224_image_2578-128x84.jpg"/>"]
Here is the method I have so far…
$.getJSON('wp-content/themes/invoke-dmd/get-client-logos.php/', function (data) {
var items = [];
$.each(data, function(key, val) {
items.push('<img src ="' + val.url + '"/>');
});
console.log(items)
$('#practice').append(items);
});
It logs out the array as above… but cannot show it in the div.
How does one do this?
Try this,