getburl wrote:
I am currently having an issue where I render 3 1k images to
the page in IE when the user clicks a button. Everything works
well in FF and Good Browsers et al., but in IE I have to wrap
some dummy code with a while(!tempImg.complete) to get each
image to load. If I do not use the while loop then somewhat
randomly the images are not visible even though they appear
to have been rendered. In this 'invisible' case I can
right-click the 'hole' where the image is and choose Show
Picture from the contectual menu and then the image appears.
'Somewhat random' problems relating to the displaying of images occurring
in IE (at least up to version 6) and occurring after the clicking of a
"button" are frequently a direct consequence of the execution of a
javascript pseudo-protocol HREF. That is, if your "button" is actually a
link, and has an HREF attribute in the form -
"javascript
:something();" -(or anything beginning "javascript
:") then the
clicking on the link is take as navigation by IE, and the current page
goes into a new 'state' pending the replacement of its contents. In that
new state various aspects of the javascript environment, and normal
browser facilities become unreliable or unavailable, including swapped
IMG sources not being rendered, at all or reliably.
So, if anyone knows how to solve this problem, I would
love to hear about it.
If that describes your situation you cure the problem by never activating
a javascript pseudo-protocol HREF that does not directly result in the
replacing of the current page. In the context of a link you could do that
by moving the javascript code from the HREF and into an onclick handler,
remembering to return false from that handler to prevent the link from
following whatever URL is specified in its HREF attribute. Or you abandon
using links to trigger javascript and instead use <input type="button">
elements (possibly heavily styled with CSS).
Richard.