Skip to main content
Inspiring
July 14, 2008
Question

Javascript function doesn't display alt text of the initial image in recordset

  • July 14, 2008
  • 2 replies
  • 329 views
I have the following javascript code to display the alt text database field of the current moused over thumbnail image. All works fine except for the initial image's alt text. It does not display:

PAGE EXAMPLE:
http://www.canchair.com/new_web_product_detail.asp?ProductID=198&ProductFamily=1&ProductFamilySub=10

HEAD SECTION JAVASCRIPT CODE:

<script type="text/javascript">
<!--
var currentImage;
function showBigImage( isource,bigImage,header ) {
var theImage = document.getElementById( 'largeimage' );
theImage.src = isource;
currentImage = bigImage;
document.getElementById('photoHeader').innerHTML=header;
document.getElementById( 'largeimage' ).alt=header;

}


PAGE CODE:

<a href="javascript:;">
<img src="imagescript.asp?path=<%= images.Fields.Item( "url_img" ).Value %>&Width=36" border="0" onmouseover="showBigImage( 'imagescript.asp?path=<%= images.Fields.Item( "url_img" ).Value %>&Width=250','<%= images.Fields.Item( "url_img" ).Value %>','<%=(images.Fields.Item("alt_img").Value)%>' )" alt="" /></a>
This topic has been closed for replies.

2 replies

aonefunAuthor
Inspiring
July 15, 2008
I actually showed the wrong page code. Here is the correct RENDERED PAGE CODE:

THE ALT TEXT FOR THEFIRST IMAGE OF THE RECORSET DOES NOT SHOW UP :

<a href="javascript:;" onclick="MM_openBrWindow('/large_image.asp?url_image=images/portable_stage.jpg','imagewindow','width=600,height=600')"><img src="imagescript.asp?path=images/portable_stage.jpg&Width=250" name="largeimage" border="0" id="largeimage" alt=""/></a>

AS WELL AS THIS ALT TEXT WHICH SERVES AS AN IMAGE CAPTION (ALTHOUGH IT SHOWS IN THE HTML CODE AS FOLLOWS):

<td width="250" height=50 valign="top" id="photoHeader">Portable stage shown with carpet deck</td>
Inspiring
July 14, 2008
Why don't you show the rendered code? (Not server code)
Mick.


aonefun wrote:
> I have the following javascript code to display the alt text database field of
> the current moused over thumbnail image. All works fine except for the initial
> image's alt text. It does not display:
>
> PAGE EXAMPLE:
>
> http://www.canchair.com/new_web_product_detail.asp?ProductID=198&ProductFamily=1
> &ProductFamilySub=10
>
> HEAD SECTION JAVASCRIPT CODE:
>
> <script type="text/javascript">
> <!--
> var currentImage;
> function showBigImage( isource,bigImage,header ) {
> var theImage = document.getElementById( 'largeimage' );
> theImage.src = isource;
> currentImage = bigImage;
> document.getElementById('photoHeader').innerHTML=header;
> document.getElementById( 'largeimage' ).alt=header;
>
> }
>
>
> PAGE CODE:
>
> <a href="javascript:;">
> <img src="imagescript.asp?path=<%= images.Fields.Item( "url_img" ).Value
> %>&Width=36" border="0" onmouseover="showBigImage( 'imagescript.asp?path=<%=
> images.Fields.Item( "url_img" ).Value %>&Width=250','<%= images.Fields.Item(
> "url_img" ).Value %>','<%=(images.Fields.Item("alt_img").Value)%>' )" alt=""
> /></a>
>