how to ensure complete loading of many gifs

T

tnhoe

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
 
G

Grant Wagner

tnhoe said:
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.
 
M

Matthew Lock

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.
 
C

c.anandkumar

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.onReadyStateChange = function () {
if (document.images.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
 
T

Tim Williams

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.
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
 

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,444
Messages
2,571,709
Members
48,796
Latest member
Greg L.
Top