IE bug?

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
 
N

Nils

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.

Does you IE use a proxy server?

I've seen several times before, that IE "gets tired" and refuses to
make new http-requests when extensively tested.

Tip: You migth have a look in the web access-log file to see if IE
really makes the request.

Nils
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top