Click to See Complete Forum and Search --> : referring to a remote image


MadCommando
07-21-2003, 04:54 PM
Is it possible to have a variable assigned to the location of a picture, and without displaying the image find it's dimensions. Ex.

<script>
picsrc="http://www.mysite.com/mypic.jpg"
picheight=img.picsrc.height
</script>

I know this is probably the wrong code, but is there a way to perform this sort of action?

sumyounguy
07-21-2003, 05:03 PM
I think its picsrc='url'
instead of "url"

Charles
07-21-2003, 05:04 PM
<script type="text/javascript">
<!--
var image = new Image();
image.src = 'http://www.bettiepage.com/images/photos/bikini/bikini1.jpg';
alert (image.height + ' x ' + image.width);
// -->
</script>

MadCommando
07-21-2003, 10:47 PM
Originally posted by Charles
<script type="text/javascript">
<!--
var image = new Image();
image.src = 'http://www.bettiepage.com/images/photos/bikini/bikini1.jpg';
alert (image.height + ' x ' + image.width);
// -->
</script> thanks a lot.