Page is a not externally linkable
- Code, Content, and Presentation
-- HTML
---- Page Design


tedster - 12:44 pm on Jan 15, 2001 (gmt 0)


mr_v, welcome to the WebmasterWorld Forums.

I often do pre-loading of images, or design so that I can reuse elements that have already been cached. You're smart to pay close attention to download times -- most "new to the game designers" don't.

I use JavaScript to pre-load images. For example, if mypicture.gif is very likely to be needed on the next click, I would insert this code at the very bottom of the HTML:

<script language="JavaScript">
<!--
image1=new Image(width,height)
image1.src="mypicture.gif"
-->
</script>

That puts the image for the next page into the cache at the end of loading the present page.

I prefer to put the script at the bottom of the HTML, so that the present page has a chance to render first. Putting it in the header or calling an external .js file will slow down the current page.


Thread source:: http://www.webmasterworld.com/html/185.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com