View Full Version : Image parameters in JavaScript

12-30-2003, 02: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.


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

<script type="text/javascript">
aa = new Image()
alert('image width = '+aa.width+'\nimage height = '+aa.height)


EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum