Re: need HTML guru for small help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jim Davis <ydavis@hkg.odn.ne.jp> writes:

> Brian Chandler <chandler@yomogi.or.jp> wrote/replied to:
> 
> ><script type="text/javascript"><!--
> >// Load bg ahead
> >var anything = new Image();
> >anything.src = "pics/clouds.jpg";
> >//-->
> ></script>
> >
> >This is entirely independent of the actual background loading, but just
> >by mentioning the image file, with luck the browser will start loading
> >it immediately. The virtue of this over possibly more elaborate schemes
> >is that if it "doesn't work" it will simply have no effect.
> >
> >Hard to test this sort of thing exhaustively, but it seemed to help my
> >index page. ( Search down source of http://imaginatorium.org/index.htm
> >for "Load graphics ahead of photos")
> >
> >Brian Chandler
> 
> I tried your code, even checked your page, you don't load a
> background, yours is plain yellow.

> I couldn't get mine to load first, will keep trying.
> 
> What truly amazes me is I haven't been able to find this, although it
> seems like it should be a default, or at the least easy to set or
> code. Many pages have figured it out though, I see pages loading
> backgrounds first all the time.

(In reverse order)

I believe the http standards say nothing at all about order of loading:
it's entirely up to the browser the order in which it sends off the
requests, and it's largely a matter of luck which bits arrive first. (It
helps if you understand the anarchic nature of the web.)

My page doesn't load a background, but I want to make sure that the
graphic bits get ordered ahead of the photos down the left, even though
the photos come earlier in the html source. So I put the bit of
javascript before that, just mentioning the filenames, so the browser
(in general) sends off a request for those files first.

<script type="text/javascript"><!--
// Load bg ahead
var anything = new Image();
anything.src = "... you did insert the background here? ....";
//-->
</script>

Is that what you did? And it had no effect? Hmm. Well there you go. It's
just possible that there are tricks one could play on the server side,
fiddling the priority of responding to particular requests. Dunno
though.


Brian Chandler
----------------
geo://Sano.Japan.Planet_3
Jigsaw puzzles from Japan at:
http://imaginatorium.org/shop/


[Index of Archives] [Share Photos] [Epson Inkjet] [Scanner List] [Gimp Users] [Gimp for Windows]

  Powered by Linux