JSFiddle - React, Tailwind, and code Playground

by roXon

JavaScript

var s; // undefined var
function getMeta(url){
  $('<img/>').attr('src', url).load(function(){
     s = {w:this.width, h:this.height};
  });
}

var inter = setInterval(function(){
  if(s!=undefined){
    alert(s.w+' '+s.h);
    clearInterval(inter);
  }
},100);

getMeta("http://www.google.hr/images/srpr/logo3w.png");