|
Posted by David Graham on 12/13/22 11:41
"Brian Cryer" <brianc@127.0.0.1.activesol.co.uk> wrote in message
news:WMudnZ3vHfST5pXZRVnysQ@pipex.net...
> <alexjaquet@gmail.com> wrote in message
> news:1141384182.613947.325780@i39g2000cwa.googlegroups.com...
> > Hi,
> >
> > I'm trying to preload image for a better user experience but it doesn't
> > work
> >
> > I find a simple script to load image
> >
> > <SCRIPT language="JavaScript">
> > if (document.images)
> > {
> > pic1= new Image(300,60);
> > pic1.src="../images/vendeur_detail_$LANG.gif\";
> > }
> > </SCRIPT>
> >
> > then I try to use it this way :
> >
> > <div id="test><img alt="" name="pic1"></div>
> >
> > but the image doesn't appear
> >
> > any help would be appreciate thx
>
> To use it, you want (using your example):
>
> <div id="test><img alt="" src="../images/vendeur_detail_$LANG.gif"></div>
>
> remember, its the browser that is doing the caching. All your preloading
is
> doing is trying to ensure that the image is already present in the cache.
> Hence why you refer to the image by its source url.
>
Hi
Do you mean that the browser will not bother to download the image if it
checks and finds the image is already in its cache?
bye
David
Navigation:
[Reply to this message]
|