I have a VERY weird problem.
I pass the image name to a function which uses its 'name', 'src', 'alt', 'width' and 'height' properties. The thing is, for half the pictures (always the sames, and I have found no pattern whatsoever), the properties return 'undefined', for the other half, they are working good.
I work with ColdFusion and this code is part of a loop, and so every image has the exact same HTML code after the query has been parsed, except for the image name/alt/src.
Here's a quite simple part of my code, I have an image with a link and a javascript popup window to display the picture full-size :
<a href="javascript
opPhoto(photo_species_603)">
<img name="photo_species_603" src="http://www.speciesatrisk.gc.ca/Species/Images/Photos/spp603p1.jpg" alt="Northern Abalone" align="right" width="200" vspace="5" hspace="5" border="1">
</a><br>
I pass the name of the image as parameter in the function.
Here is the function :
<script language="Javascript">
function popPhoto(nom_photo) {
fen=window.open("","fen_visu","directories=no, width=500, height=500, location=no, menubar=no, personalbar=no, resizable=no, scrollbars=yes, toolbar=no");
fen.document.writeln('<div align="center">');
fen.document.writeln(nom_photo.name+'<br>'+nom_photo.alt+'<br><img src="'+nom_photo.src+'" name="la_photo">');
fen.document.writeln('<br>Width:'+fen.document.la_photo.width+' Height:'+fen.document.la_ photo.height+'<br>');
fen.document.writeln('<p align="right"style="font-family: Arial, Helvetica, Sans-Serif; font-size: 12pt; padding-right: 10px;"><a href="javascript:window.close()">Close</a></p>');
fen.document.writeln('</div>');
fen.document.close();
fen.focus();
}
</script>
Has anyone ever run into this? I am seriously lost as it works on some... The only thing I could think was that maybe, somehow, the parameter passed (the image-object name) is invalid...
Thanks,
Pascal
I pass the image name to a function which uses its 'name', 'src', 'alt', 'width' and 'height' properties. The thing is, for half the pictures (always the sames, and I have found no pattern whatsoever), the properties return 'undefined', for the other half, they are working good.
I work with ColdFusion and this code is part of a loop, and so every image has the exact same HTML code after the query has been parsed, except for the image name/alt/src.
Here's a quite simple part of my code, I have an image with a link and a javascript popup window to display the picture full-size :
<a href="javascript

<img name="photo_species_603" src="http://www.speciesatrisk.gc.ca/Species/Images/Photos/spp603p1.jpg" alt="Northern Abalone" align="right" width="200" vspace="5" hspace="5" border="1">
</a><br>
I pass the name of the image as parameter in the function.
Here is the function :
<script language="Javascript">
function popPhoto(nom_photo) {
fen=window.open("","fen_visu","directories=no, width=500, height=500, location=no, menubar=no, personalbar=no, resizable=no, scrollbars=yes, toolbar=no");
fen.document.writeln('<div align="center">');
fen.document.writeln(nom_photo.name+'<br>'+nom_photo.alt+'<br><img src="'+nom_photo.src+'" name="la_photo">');
fen.document.writeln('<br>Width:'+fen.document.la_photo.width+' Height:'+fen.document.la_ photo.height+'<br>');
fen.document.writeln('<p align="right"style="font-family: Arial, Helvetica, Sans-Serif; font-size: 12pt; padding-right: 10px;"><a href="javascript:window.close()">Close</a></p>');
fen.document.writeln('</div>');
fen.document.close();
fen.focus();
}
</script>
Has anyone ever run into this? I am seriously lost as it works on some... The only thing I could think was that maybe, somehow, the parameter passed (the image-object name) is invalid...
Thanks,
Pascal
Comment