anakintang
08-13-2004, 12:56 PM
in JavaScript I want to get the width and height of an image online (through url) before I put it on my HTML, how can I do it? Thanks
agent002
08-13-2004, 01:05 PM
something like this?
<script>
window.onload = function(){
alert('width: '+loadImage.width+', height: '+loadImage.height);
}
var loadImage = new Image();
loadImage.src = 'image.jpg';
</script>
vBulletin® v3.6.7, Copyright ©2000-2009, Jelsoft Enterprises Ltd.