By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,624 Members | 1,643 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,624 IT Pros & Developers. It's quick & easy.

how to ensure complete loading of many gifs

P: n/a
Hi,

how do i code such that all gifs are loaded without missing any one of them ?
I always get missing few gifs when the page loading with 30 gifs.
I use IE6 to browse many <a href='myurl'><img src='mygif.gif'></a>

Regards
Hoe
Jul 23 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
> "tnhoe" <tn***@pc.jaring.my> wrote in message
news:42**********@news.tm.net.my...
Hi,

how do i code such that all gifs are loaded without missing any one of
them ?
I always get missing few gifs when the page loading with 30 gifs.
I use IE6 to browse many <a href='myurl'><img src='mygif.gif'></a>

Regards
Hoe


If your server, client, some proxy or network setup is somehow dropping
http connections while retrieving images from the server, there is
nothing client-side JavaScript can do to help you.

--
Grant Wagner <gw*****@agricoreunited.com>
comp.lang.javascript FAQ - http://jibbering.com/faq
Jul 23 '05 #2

P: n/a
Try using the LiveHttpHeaders extension in Firefox to see exactly why
certain images aren't being loaded: http://livehttpheaders.mozdev.org/

Maybe the server you are using can only handle so many connections at a
time like IIS in Windows 2000 Pro or XP Pro, and is therefore denying
connections over a certain limit.

Jul 23 '05 #3

P: n/a
All images are populated in the document.images array. You could assign
an onReadyStateChange event to each of the images you want to make sure
to be loaded completely.
And then you could check for the readystate variable for any of these
values - "uninitialised", "complete", "loading", and one more which i
dont remember
document.images[i].onReadyStateChange = function () {
if (document.images[i].readystate == complete) {
// This image has finished loading. You could set some flags
to do your post-processing after _all_ images are loaded
}
}
One thing Im not very sure is whom do you assign the onReadyStateChange
event. I guess it is for each object in the document.images[] array.
But can someone correct me if im wrong here?

Thanks

Anand

Jul 23 '05 #4

P: n/a
Once the page has loaded you could check each image to see if it has
loaded (you can figure out how no doubt) and assign its src again
(maybe with a random querystring attached). That will at least "kick"
the unloaded ones to try again to load.

Tim.
"tnhoe" <tn***@pc.jaring.my> wrote in message
news:42**********@news.tm.net.my...
Hi,

how do i code such that all gifs are loaded without missing any one of
them ?
I always get missing few gifs when the page loading with 30 gifs.
I use IE6 to browse many <a href='myurl'><img src='mygif.gif'></a>

Regards
Hoe
Jul 23 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.