[thelist] Javascript Help Needed

Ben Henick persist1 at io.com
Tue May 14 19:03:01 CDT 2002


On Tue, 14 May 2002, Locke wrote:

> Here's the conundrum: I am making a website that uses pull-down menus and
> GIFs to make a multi-layered display of some map data. I have it working
> quite well at the moment, but there is a minor problem. Due to my lack of
> experience in such ventures, I wrote the javascript in such a way that it
> preloads all the images (over 1 thousand). This is quite a bad thing to do,
> and a fo pas in my undrestanding.

Argh.

It sounds like - first and foremost - you need to put some more thought
into the application design.

If you're using JavaScript to swap out images (an implementation which
poses a few problems for accessibility), just don't preload anything...

The 'new Image()' statements can be made on the fly and the subsequent
images dropped in the place of whatever .src is there at the time, though
in this case you'll probably want to generate the object names randomly.

For the most part, it boils down to how you write the function that sits
behind the onclick event, or the HREF's for your wayfinding links.


--
Ben Henick
Web Author At-Large              Managing Editor
http://www.io.com/persist1/      http://www.digital-web.com/
persist1 at io.com                  bmh at digital-web.com
--
"Are you pondering what I'm pondering, Pinky?"
"I think so, Brain, but... (snort) no, no, it's too stupid."
"We will disguise ourselves as a cow."
"Oh!" (giggles) "That was it exactly!"




More information about the thelist mailing list