javascript - jquery synchronous execution -


i trying resoution of remote image.

function getmaxres(url) {     var imgheight=0;      $("<img/>").attr("src", url).load(function(){          s = {w:this.width, h:this.height};          imgheight =  this.height ;            console.log(imgheight); // printed correctly        });       console.log(imgheight); //prints 0  } getmaxres(< url image > ) 

i have tried using global variables. how can make function return image height.


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -