Lunarpages Web Hosting Forum

Author Topic: Check to see if preloading already done?  (Read 1879 times)

Offline aerph

  • Newbie
  • *
  • Posts: 5
Check to see if preloading already done?
« on: April 21, 2005, 08:28:04 PM »
Our web page preloads the same 18 'gif' files for the nav buttons (with rollovers) for 8 of the nine primary pages on the site.  The preloading of these small images is handled by a calling an external javascript (js) file which works well, but it runs every time a new page is loaded, in my mind, whether it's needed or not.  I think the preload should only happen once, but I can't control which page a user loads first.

Maybe this isn't a problem since I don't know if browsers actually repeat the preload if the images are already cached (?) ... but it seems to me that the script should contain an IF, ELSE to test whether the image variables are empty (not yet preloaded).  I'm new at this, have tried several approaches, but haven't yet succeeded.  Any suggestions?

Offline GMTurner

  • Berserker Poster
  • *****
  • Posts: 7479
    • Turner's Lounge
Check to see if preloading already done?
« Reply #1 on: April 21, 2005, 09:18:40 PM »
Chances are the images would be loaded from the cache after they visit the first page, so although the preload script runs multiple times, it shouldn't have that much of an effect on load time....
The above information may or may not reflect current policy, opinions, or views since it was likely made almost 10 years ago.