[Javascript] image preloader doubts

Paul Novitski paul at juniperwebcraft.com
Thu Jul 20 09:55:56 CDT 2006


At 06:38 AM 7/20/2006, suresh kumar wrote:
>    Thanxs for reply.our project is displaying ads in the mall,shop 
> using digital signange system(myadtv.com).suppose if the customer 
> want to display the ad content it means-image ad,background image 
> ad,text and itext Ad,maximum allowed ad for the particular user is 
> 200.if he post different images for each ad,it leads to 200,so that 
> i am asking whether image preloader function is sufficient to 
> handle this task ,whether it will effect the user's RAM at run 
> time,usually image preloader will load the images to the RAM,am i 
> right,i want to know  how image preloader function works


The most common type of image pre-loader I've seen creates Image 
objects in the page header, setting the src of each object to a 
separate image file path.  The images are therefore encouraged to 
download before any of the page content.  These Image objects 
themselves do not typically display on the page; they are simply 
vehicles for caching the images so that when they are called up by 
IMG elements in the page body they display much more quickly.

While I'm sure that image pre-loading reads the downloaded images 
into RAM, they probably aren't stored there but instead are written 
to the local hard drive as part of the local internet content 
database.  (Even if they were stored in RAM, the local computer's 
memory management logic would handle this issue, writing out virtual 
memory to disk as needed to maintain operation; you don't need to 
worry about this on the high level of JavaScript programming.)

If you pre-load 200 images in this way, the greatest disadvantage 
will be an extended delay before the rest of the page renders.  In my 
personal view, to delay requested page content significantly for the 
sake of advertising effect epitomises some of the worst practices on 
the net.  If my browser were not set to block this type of ad, I 
would choose never to return to such a website again.  I'm sure I'm not alone.

What you might consider doing is to allow the page to download 
normally with only the first image displayed in your ad; then after 
page-load start downloading the additional images.

Regards,
Paul 




More information about the Javascript mailing list