OT : Javascript image size undefined
OT : Javascript image size undefined
- Subject: OT : Javascript image size undefined
- From: Alisha Outridge <email@hidden>
- Date: Mon, 21 Jun 2004 15:38:29 -0400
I am running Webstar 4.2 and I have tried a variety of scripts below
that claim to successfully get the width and height of
any images but they come out "undefined" for me. Is it a Mac server
issue? How does one go around it? the code i am using is below. It
seems the issue is that my browser/server is not preloading the images
as it needs to so it can know the size in time to calculate the width
and height.
<img src="images/buttons/navmenu/about.gif">
// Note: Image shows with direct HTML above so linkage is correct.
<script>
var img = new Image();
img.src = "images/buttons/navmenu/about.gif";
alert("Width = "+img.width+"\nHeight = "+img.height)
</script>
//Note: Width and height are undefined.
The code above is all I have on the page other than the html and body
tags ofcourse. Does anyone know if Webstar blocks this information from
showing up or if you can successfully get the width on your servers of
an image? I know Webstar has quirky security features and I seriously
doubt that I coded the above incorrecftly. I hope I did though! Any
help would be appreciated!
Alisha Outridge
Spec Simple Inc.
Where the world of design connects...
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.