[Javascript] Writing <img> to <div>

Muchacho, Laurent (TWIi London) LMuchacho at twii.net
Mon Jun 10 04:42:32 CDT 2002


Hi Andrew 

I have a small question 
In which browser that bug appear? 
you must try to make a function and called it when the document is loaded
instead of having the code on the flow of the document as you did 
NS6 will do that bug really often (don't know why)

Laurent 



-----Original Message-----
From: Andrew Gibson [mailto:andyg at ihug.co.nz]
Sent: 08 June 2002 23:46
To: javascript at LaTech.edu
Subject: [Javascript] Writing <img> to <div>


I've having a problem when writing to a <div> getting content from another
<div> when an image is involved.

Like so:

<div id=one>
Here is my image <br><img src=myImage.gif>
</div>
<div id=two>
</div>

<script>
var txt=document.getElementById("one").innerHTML
document.getElementById("two").innerHTML=txt
</script>

The script doesn't always display the image...yet when I right click and
select Show picture, it shows it....almost as if the image is not downloaded
by the time the div .innerHTML is written it won't display the image?


Andrew Gibson



_______________________________________________
Javascript mailing list
Javascript at LaTech.edu
https://lists.LaTech.edu/mailman/listinfo/javascript


DISCLAIMER - The preceding e-mail message (including any attachments)
contains information that may be confidential, may be protected by the
attorney-client or other applicable privileges, or may constitute non-public
information.  It is intended to be conveyed only to the designated
recipient(s) named above.  If you are not an intended recipient of this
message, or have otherwise received it in error, please notify the sender by
replying to this message and then delete all copies of it from your computer
system.  Any use, dissemination, distribution, or reproduction of this
message by unintended recipients is not authorized and may be unlawful. The
contents of this communication do not necessarily represent the views of
this company.



More information about the Javascript mailing list