Page 1 of 1

best method to preload images

Posted: Wed Dec 06, 2006 4:34 pm
by amir
I'm developing a site and i'm trying to stay away from using JavaScript functionality.

The site will contain alot of small, medium and large images and at the moment im using the commonly used function:

Code: Select all

MM_preloadImages()
that Dreamweaver uses...

I want some advice on what is best to use - a client-side preload script using above function or a server-side preload script using PHP?

Remember, my reason for this, is due to alot of web users these days have JavaScript disabled so hence why i'm trying to stay away from using it...

TIA!

Posted: Wed Dec 06, 2006 4:42 pm
by kaszu
What do you mean with "server side preload script"?

If you want to preload images (load images into memory and then displayed to the user without loading time, as i understand it), then it has to be on client side and only possible way i know is using javascript.

http://www.w3schools.com/browsers/browsers_stats.asp (90% has javascript turned on).

Posted: Wed Dec 06, 2006 4:43 pm
by Ollie Saunders
btw there is a client side forum for this stuff.

I've done something like this in the past:

Code: Select all

<style type="text/css">
img .preload { display:none; }
</style>
<img class="preload" width="0" height="0" src="imagetopreload.gif" alt="a preloaded image" />
but the extra markup isn't particularly great. So I'm sure there will be better solutions.