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
Post a Comment