We are working on a problem where images are not consistently loading when a
large constructed HTML string is assigned to the innerHTML of an element.
The images exist in the document but for those images that do not appear,
the image.complete value is false. No loading errors occur. It is very
inconsistent as sometimes the images will load. Clearing the browser cache
causes the problem more, then simply reloading, which seems to eventually
make most of the images appear.
The HTML string is over 2k bytes long and has six different image references
as well as text and controls. The text always shows up, the drop down list
boxes always show up but things like buttons don't always show up.
Does anyone have any ideas?
I suppose you are experiencing the problem on IE5 (no problem with NS,
strange enough! ;-), where I had the same problem. The solution was to
"preload" images through the Image object ( var = new Image() etc. etc.).
Hope this help
Regards
Roberto Galanti
Paula K <pau...@geocities.com> wrote in message
#1ywChHK$GA.226@cppssbbsa05...
Paula
Roby <rgal...@iol.it> wrote in message news:eJEH0BIK$GA.232@cppssbbsa05...
Yo,
I'm investigating...
Peter
--
Peter J. Torr - Microsoft Windows Script Program Manager
pt...@microsoft.com - http://msdn.microsoft.com/scripting/
Please do not e-mail me with questions - post them to this
newsgroup instead. Thankyou!
Someone suggesting this work-around - basically, after adding the innerHTML,
you then insert some adjacentHTML and immediately remove it. This should
cause the element to repaint.
var Elem = document.whatever;
Elem.innerHTML = "whatever";
var Index = Elem.sourceIndex;
// Fixup the image bug
setTimeout("forceImagePaint()",100);
// Forces repainting of an image by inserting a dummy image
// and then removing it
function forceImagePaint()
{
Elem = tbContentElement.DOM.all[Index];
Elem.insertAdjacentHTML("beforeEnd","<img id='imgHack' " +
"style='display:none' src='/images/1pxt.gif'>");
document.all.item("imgJ").outerHTML="";
Thanks.
__________________
In article <ug3RUbgK$GA.242@cppssbbsa04>,
--
Eddie, eddie...@yahoo.com (remove 123 to email)
http://www.angelfire.com/pe/eddie
Sent via Deja.com http://www.deja.com/
Before you buy.
"Paula K" <pau...@geocities.com> wrote in message news:ur2B$brN$GA....@cppssbbsa02.microsoft.com...Okay, here is very interesting code frag for all you trying to figure out
why all the images you load in an insertadjacentHTML do not always load!
There are four tests. Three out of the four work fine. One of the four
(the way one would expect it to work) has the chacteristic of trying to load
4 (count them!) images after the insertadjacentHTML and the browser will
just sit their spinning until it times out! (occassionally actually getting
the images after many minutes!) Perhaps Microsoft could comment on why, so
that we could all understand the specific folk lore we need to know to keep
our code running! (I really _do_ like the MS guys, but lets face it, there
is a lot of folk lore in making things run right!)
Send me your comments! What am I doing wrong! Give me a hint why this
happens and I'll be _very_ happy
from the inquireing mind of Paula!
Thanks for reading this!