This message is somewhat old, but no solution was posted:

The image tag has an onload event. You may try somthing with that
img src="" onload="this.src='whatever'"

----- Original Message -----
From: "Leif Wessman" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, September 23, 2003 4:15 AM
Subject: [Dynapi-Help] How to change the src of an image in a layer before
the document is loaded?


>
> Hi,
>
> How do I change the src of an image in a DynLayer (with javascript) -
before
> the document is loaded? It seems as if DynAPI.document is not accessible.
Is
> there a way to make it accessible or how should I do it???
>
> Please not that It's not possible for me to wait until the page is fully
> loaded. I have to change the image before...
>
> Thank you for your help!!
>
> This is my code:
>
> <html>
> <head>
> <script language="JavaScript" src="/js/dynapi.js"
> type="text/javascript"></script>
> <script language="JavaScript" type="text/javascript">
> <!--
> DynAPI.setLibraryPath('/js/lib/');
> DynAPI.include('dynapi.api.*');
> DynAPI.include('dynapi.ext.inline.js');
> //-->
> </script>
> </head>
> <div id="mylayer" style="position:absolute">
> <img name="myimage" src="/box.empty.gif">
> </div>
> <script language="JavaScript" type="text/javascript">
> <!--
> // it seems as if the DynAPI.document does not exist
> DynAPI.findLayers(DynAPI.document);
>
> // and that's the reason that I can't change the image in the layer
> DynAPI.document.all["mylayer"].images['myimage'].src = '/box.check.gif';
> //-->
> </script>
> </html>
>
> Leif
>
> _________________________________________________________________
> L�ttare att hitta dr�mresan med MSN Resor http://www.msn.se/resor/
>
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> Dynapi-Help mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/dynapi-help
>


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.522 / Virus Database: 320 - Release Date: 9/29/03



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Dynapi-Help mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dynapi-help

Reply via email to