Get Imagesize in jQuery
- by Jean
Hello,
I want to get the imagesize in jquery, I have this code. It works to the point of
alert (v);
I wonder what is wrong with the rest when v actually contains a value.
var v = $('#xxx input').val();
alert (v);
var newImg = new Image();
newImg.src = v;
var height = newImg.height;
var width = newImg.width;
alert ('The image size is '+width+'*'+height);
Thanks
Jean