469,287 Members | 2,770 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,287 developers. It's quick & easy.

how to ensure complete loading of many gifs

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
4 1323
> "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
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
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
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.

Similar topics

reply views Thread by jerrygarciuh | last post: by
11 posts views Thread by Detlef Hüttenbach | last post: by
reply views Thread by GrandpaB | last post: by
2 posts views Thread by hbchai | last post: by
2 posts views Thread by Scirious | last post: by
reply views Thread by helraizer1 | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.