JSFiddle - React, Tailwind, and code Playground
by oterral
HTML
<textarea id="showresult"></textarea>
JavaScript
var showout = document.getElementById("showresult");
showout.value = ' ';
var xhr = new XMLHttpRequest();
xhr.open('GET','http://wmts9.geo.admin.ch/1.0.0/ch.swisstopo.pixelkarte-farbe/default/20140520/21781/21/113/178.jpeg', true);
xhr.responseType = 'arraybuffer';
xhr.onload = function(e) {
showout.value += ' load';
};
xhr.onerror = function(e) {
showout.value += ' error';
console.debug(e);
};
xhr.onabort = function(e) {
showout.value += ' abort';
console.debug(e);
};
xhr.onloadend = function(e) {
showout.value += ' loadend';
};
xhr.send();