C
case
I have this line of code in a js function, which is called by the
onclick event of myImage :
document.getElementById("myImage").src = myOtherImage.src;
It works - the source of the image is set successfully. My problem is
that in IE, most times the image goes blank. If you right click and
choose "show image", the new image shows up. Occasionally, the image
will show up on its own without having to choose show image. If I
refresh the page and click myImage, the new image almost always shows
up properly, but every once in a while it will not.
Here is what I have tried so far, none of these changed the behavior:
- I verified my "show images" box was checked in the advanced
settings of my internet options.
- I tried adding this code after the line that reset the src:
document.getElementById("myImage").style.display="none";
document.getElementById("myImage").style.display="inline";
- I tried adding return false; after the line that reset the src
However, adding alert("hi"); after the line that reset the src appears
to fix the bug. the image ALWAYS displays (??!)
I am not having any problems in Firefox.
Thanks in advance for your help,
c
onclick event of myImage :
document.getElementById("myImage").src = myOtherImage.src;
It works - the source of the image is set successfully. My problem is
that in IE, most times the image goes blank. If you right click and
choose "show image", the new image shows up. Occasionally, the image
will show up on its own without having to choose show image. If I
refresh the page and click myImage, the new image almost always shows
up properly, but every once in a while it will not.
Here is what I have tried so far, none of these changed the behavior:
- I verified my "show images" box was checked in the advanced
settings of my internet options.
- I tried adding this code after the line that reset the src:
document.getElementById("myImage").style.display="none";
document.getElementById("myImage").style.display="inline";
- I tried adding return false; after the line that reset the src
However, adding alert("hi"); after the line that reset the src appears
to fix the bug. the image ALWAYS displays (??!)
I am not having any problems in Firefox.
Thanks in advance for your help,
c