Hi
A few pages on my website have different medium sized images.
To speed up page loads, when users visit my home page, I would like to pre-load the other page's images
into the browser cache.
Should I add my preload script to the head section of my home page or should I place the script in an
external javascript file and link the file to my home page?


Code:
function preloader()  {      
// counter     var i = 0;      
// create object    
imageObj = new Image();     
 // set image list     
images = new Array();    
images[0]="image1.jpg"   
images[1]="image2.jpg"    
images[2]="image3.jpg"     
images[3]="image4.jpg"      
// start preloading     
for(i=0; i<=3; i++)      {         
imageObj.src=images[i];     
}  }