tags:

views:

17

answers:

0

I am preloading images via JS like so:

Image1= new Image(234,273)
Image1.src = "001.png"

The images successfully get called on page load (confirmed from the Firebug Net panel).

After that, there's a button that triggers a function which replaces an image like so:

document.getElementById("myImage").src = "001.png";

The problem is that when that function is called it's reloading the 001.png file, even though it was previously loaded.

Any ideas on why it does that / how to avoid it?