JSFiddle - React, Tailwind, and code Playground

by Qwerty_Wasd

HTML

<script src="http://www.google.com/jsapi"></script>
<img id="img1" width="100" alt="[KEY]" title="[KEY]">

JavaScript

google.load('jquery', '1.4.2');
google.setOnLoadCallback(function()
{
var image_key=encodeURIComponent('[KEY]');
function getimage(id) {
    $('#img1')['attr']('src', 'http://www.ajaxload.info/images/exemples/26.gif');
    $['getJSON']('http://ajax.googleapis.com/ajax/services/search/images?v=1.0&q=' + image_key + '&rsz=2&imgsz=medium&callback=?', function (json) {
        $('#img1')['attr']('src', (json['responseData']['results'][id]['url']));
        $('#img1')['error'](function () {
            getimage(id + 1);
        });
    });
};
getimage(0);
});