1// GET BLOB FROM XML REQUEST (JAVASCRIPT)
2var xhr = new XMLHttpRequest();
3xhr.open("GET", "http://localhost/image.jpg");
4xhr.responseType = "blob";
5xhr.onload = response;
6xhr.send();
7// MAKE A RESPONSE FUNCTION (JAVASCRIPT)
8function response(e) {
9 var urlCreator = window.URL || window.webkitURL;
10 var imageUrl = urlCreator.createObjectURL(this.response);
11 document.querySelector("#image").src = imageUrl;
12}
13// MAKE OUTPUT IMG (IN HTML)
14<img id="image"/>
15 // THIS IS OPEN SOURCE I DO NOT OWN THIS //