Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Dec 2003
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile Image parameters in JavaScript

    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

  • #2
    Banned
    Join Date
    Sep 2003
    Posts
    3,620
    Thanks
    0
    Thanked 0 Times in 0 Posts
    This should get you started:
    Code:
    <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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •