• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
OT : Javascript image size undefined
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


  • Follow-Ups:
    • Re: OT : Javascript image size undefined
      • From: Graff <email@hidden>
    • Re: OT : Javascript image size undefined
      • From: Walter Ian Kaye <email@hidden>
  • Prev by Date: Re: Error with GURL/GURL
  • Next by Date: Re: Error with GURL/GURL
  • Previous by thread: Re: Fonts in Illustrator CS
  • Next by thread: Re: OT : Javascript image size undefined
  • Index(es):
    • Date
    • Thread