JSFiddle - React, Tailwind, and code Playground
by ifandelse
JavaScript
// Our very special jQuery JSON fucntion call to Flickr, gets details
// of the most recent 20 images
$.getJSON("http://api.flickr.com/services/feeds/groups_pool.gne?id=998875@N22〈=en-us&format=json&jsoncallback=?", displayImages);
function displayImages(data) {
$.each(data.items, function(i,item){
// I only want the ickle square thumbnails
var sourceSquare = (item.media.m).replace("_m.jpg", "_s.jpg");
// Here's where we piece together the HTML
htmlString += '<li><a href="' + item.link + '" target="_blank">';
htmlString += '<img title="' + item.title + '" src="' + sourceSquare;
htmlString += '" alt="'; htmlString += item.title + '" />';
htmlString += '</a></li>';
});
// Pop our HTML in the #images DIV
$('body').html(htmlString);
// Close down the JSON function call
}