Welcome to WebmasterWorld Guest from 54.204.74.171

Forum Moderators: open

Message Too Old, No Replies

Preload using js

   
2:29 am on Jun 28, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Is there a way I can preload a class file and a zip file for a java applet on the next page using js on the current page?
7:28 am on Jun 28, 2001 (gmt 0)

10+ Year Member



Would placing the java applet into a hidden layer on the previous page do the trick for you?
7:45 am on Jun 28, 2001 (gmt 0)

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member



I don't know of a JavaScript technique, but here's another shot at a pure java one:

[tropo.com...]

3:02 pm on Jun 28, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Cool. It was simpler than I made it out to be after all. I know most people don't like java applets but I have some that I think are extremely neat.
10:59 pm on Jun 28, 2001 (gmt 0)

10+ Year Member



From the page tedster referenced above comes:

"And just for completeness, the standard HTML trick of preloading images is done via putting something like this:  

<img src="big.gif" width=1 height=1>

on a page before "big.gif" is needed - then when it is later loaded it will appear instantly as it will be in the browser image cache."

Well, that was not standard information for me and is a fantastic pickup for precisely what I need. Thank you.

11:30 pm on Jun 28, 2001 (gmt 0)

10+ Year Member



Yep - good trick! Will be using that soon.
3:10 am on Jun 29, 2001 (gmt 0)

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member



The 1x1 image pre-load has the benefit of being pure HTML rather than JavaScript. But the method has the downside of creating a dot on the page.

If you trust using JavaScript, you can get an invisible preload by including this at the very bottom your HTML code (so it doesn't slow down the loading for the visible page:

<script type="text/javascript" language="JavaScript">
<!--

big=new Image(width,height)
big.src="big.gif"

//-->
</script>

All this code does is cache the image for later use, the way you would do with a roll-over image, and nothing is visible until you want it to be.