JSFiddle - React, Tailwind, and code Playground
by cgtrman
JavaScript
var image;
function onload () {
alert(image.height, image.width);
}
image= new Image();
image.src="https://www.google.com/intl/en_com/images/srpr/logo3w.png";
// check if image is already loaded to cache
if (image.complete) {
alert('image already loaded to browser');
onload();
} else {
// or bind onload handler for image
image.onload = onload;
}