Closed Thread Icon

Preserved Topic: Preload Pages that link to <a href="https://ozoneasylum.com/backlink?for=18248" title="Pages that link to Preserved Topic: Preload" rel="nofollow" >Preserved Topic: Preload\

 
Author Thread
Osaires
Paranoid (IV) Inmate

From: oslo, Norway
Insane since: Aug 2001

posted posted 10-04-2001 02:23

i just made a preload script, in the script i run a preload check if the picture is realy loaded it returns true if i run it localy and false if i run it troug the internet
some one know what's roung

this is the link if you want to the preload page http://www.osaires.d2g.com

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 10-04-2001 03:13

You're running the script to check if they've loaded immediately after you write the image tags. Locally, the images are loaded so fast that the tests return true - because the images are loaded right when the image tags are written. Over the internet, however, it takes the images longer to load, so they haven't loaded by the time the loadimages() function is called.

Try this: change

for (p=0; p<imgs.length; p++) { loadimages(p); }

to

setInterval('for (p=0; p<imgs.length; p++) { loadimages(p); }',500);

That will rerun the check to see if images have loaded every half a second, instead of just once. You'll see that after a small length of time, all the images become loaded.

Osaires
Paranoid (IV) Inmate

From: oslo, Norway
Insane since: Aug 2001

posted posted 10-04-2001 03:23

Thanks, slime
it works jippy

Dark
Neurotic (0) Inmate
Newly admitted
posted posted 10-05-2001 04:46

just as a very small side note: do you know that all your tut links are broken?

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 10-05-2001 05:11

As a slightly bigger side note, you may also be interested to know about the image.onload event:

preImages[i].onload = somefunction;

then you can just keep track of how many images have loaded in that way. It's just another way to do it.

Osaires
Paranoid (IV) Inmate

From: oslo, Norway
Insane since: Aug 2001

posted posted 10-05-2001 13:47

Yes i know dark, this page is not finish at all. it just a project i made for learning javascript and php


« BackwardsOnwards »

Show Forum Drop Down Menu