Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

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

Participant ,
Jul 14, 2008 Jul 14, 2008
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>
TOPICS
Server side applications
330
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 14, 2008 Jul 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>
>
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jul 15, 2008 Jul 15, 2008
LATEST
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>
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines