img wip
parent
d221dc16a0
commit
c08b00b7bc
@ -0,0 +1,10 @@
|
||||
document.querySelector('input[type="file"]').addEventListener("change", function () {
|
||||
if (this.files && this.files[0]) {
|
||||
var img = document.querySelector("img");
|
||||
img.onload = () => {
|
||||
URL.revokeObjectURL(img.src); // no longer needed, free memory
|
||||
};
|
||||
|
||||
img.src = URL.createObjectURL(this.files[0]); // set src to blob url
|
||||
}
|
||||
});
|
Loading…
Reference in New Issue