...

View Full Version : Image parameters in JavaScript



asuhoy
12-30-2003, 03:41 PM
Does anyone know how to get an image from a directory and to check its width or height? No HTML, please, just JavaScript.

Basically, I need to get a contact with a server, so I'm planning to get a small image and check either boolean value (True/False) or width/height to make sure I have a connection to the server.

Please HELP.

Appreciate,
Alexandra

Willy Duitt
12-30-2003, 07:09 PM
This should get you started:

<script type="text/javascript">
aa = new Image()
aa.src='http://www.thenorthwest.com/image_pillow/titans.gif';
alert('image width = '+aa.width+'\nimage height = '+aa.height)
</script>

.....Willy



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum