1833832 Members
2681 Online
110063 Solutions
New Discussion

JavaScript question...

 
Simon Abbott
Frequent Advisor

JavaScript question...

Hello,

Previously when I wanted an image to load before moving on to anything else (for image rollovers for example), I've used

simon = new Image
simon.src="simon.gif"

in the HEAD section of my page.

In the script I am writing now however, I would like an image to download into cache in a function and then either test that it has downloaded or not move on until it has. Is this possible?

For example
simon = new Image
simon.src="simon.gif"
// Test code or wait until image is loaded
myFunction()

Many thanks,

Simon.
I'm still working on that one