JSFiddle - React, Tailwind, and code Playground

by sparkup

HTML

<img id="image" alt="jsfiddle">

CSS

html, body {
    padding: 10px;
    background:#4679bd;
}

JavaScript

var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function(){
    if (this.readyState == 4 && this.status == 200){
        var img = document.getElementById('image');
        var url = window.URL || window.webkitURL;
        img.src = url.createObjectURL(this.response);
    }
}
// Relative path because : 
// No 'Access-Control-Allow-Origin' header is present...
xhr.open('GET', '/img/logo.png');
xhr.responseType = 'blob';
xhr.send();