After page load image rendering in IE

G

getburl

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.

So, if anyone knows how to solve this problem, I would love to hear
about it.
 
V

VK

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.

I don't know of your particular case - a URL would be most helpful. I
noticed a random funny behavior of IE 6 on some sites where image
placeholders are shown despite images are cached and "loaded" as far
as DOM is concerned. Using "Show image" from contextual menu makes the
image appear. This behavior appeared this year only AFAIK - and I
noticed it on a random basis but only on rather "sound" sites like say
NASA Saturn section <http://saturn.jpl.nasa.gov/home/index.cfm>
That makes me wonder if some fancy header/protocol went into fashion
on corporate servers and IE6 chokes on it. Pure speculation, can be
totally unrelated to your problem. Some URL would really help.
 
G

getburl

noticed a random funny behavior of IE 6 on some sites where image
placeholders are shown despite images are cached and "loaded" as far
as DOM is concerned. Using "Show image" from contextual menu makes the
image appear. This behavior appeared this year only AFAIK - and I
noticed it on a random basis but only on rather "sound" sites like say
NASA Saturn section <http://saturn.jpl.nasa.gov/home/index.cfm>
That makes me wonder if some fancy header/protocol went into fashion
on corporate servers and IE6 chokes on it. Pure speculation, can be
totally unrelated to your problem. Some URL would really help.

This application is not in a publicly accessible space at the moment
so I can't provide a URL, sorry. This is quite bothersome since it
seems that the only thing IE is not doing is drawing the image. The
image is in the dom, it is taking up space visually on the displayed
page, but there is nothing in its place. There is not even the little
red X. It seems odd that IE would take so long to get a new copy of
the image from the server though. I know it does not take a minute to
get 3 1k images from our server because the initial page is more than
3k and returns in less than a second.

Please, more speculation. It does help. Thank you.
 
V

VK

On Jan 29, 11:38 am, "VK" <[email protected]> wrote:
Please, more speculation. It does help. Thank you.

Without a single hint that would take forever making theories. The
first thing would be to re-check the most obvious, even if it seems
correct.
1) Make sure that image URLs are bulletproof correct in all cases.
2) Make sure that your script doesn't generate any errors

If persists then make the minimum case reproducing your problem and
post the code here. Also what is your server: IIS or Apache or some
other? If (1) and (2) checked this may gain some misterious to the
moment importance.
 
R

Richard Cornford

getburl said:
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.
 
G

getburl

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.

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.

Richard,

YOU ARE THE MAN!!
You were fully correct and I appreciate your time and effort. I doubt
I will be able to, but I do hope that I can return the favor some
time. You topped out my current application with your solution and
ended my frustration.

Thank you.

Adam
 

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

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top