Hello there,

I use javascript to preload images as show below. The problem is that every time a page is refreshed, it preloads again. Is there any way to get an image into memory that stays there forever without any more preloading?


<script type='text/javascript'>
if (document.images) {
img001 = new Image(); img001.src = 'images/background.jpg ';
img002 = new Image(); img002.src = 'images/banner.jpg ';
}
</script>

At the risk of sounding rude, this is a question best posed to the Javascript / AJAX/ DHTML forum area. Some of the vets here get a bit snippy if you talk about one thing in a different area. :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.