[thelist] Javascript Help Needed

Ben Henick persist1 at io.com
Tue May 14 19:55:00 CDT 2002


On Tue, 14 May 2002, Locke wrote:

> <chuckle> The onClick function is about as simple as I can make it. It seems
> that may be the root of the problem here. It just loads an image from an
> array based on 3 variables set by user input.

Uh-huh.

What you need are the environmental data:

1.  Which quadrant is in focus?
2.  Which layer(s) are set to true?

If you know which quadrant is in focus, you can put the adjacent quadrants
behind your event handlers, which takes care of criterion #1.

There's no reason why you can't hold your layer state in a static array,
which takes care of criterion #2.

When the oncklick/href function fires, re-evaluate that data and execute
something like this:

randomblahblah = new Image();
randomblahblah.src = // parsed and reassembled from function arguments;
                     // probably set equivalent to a variable beforehand
document.images["map_view"].src = // same as previous line

Provided the user's caching is set up properly, extensive use of the back
button (or other methods of re-traversing data) can be called directly
from the cache.  Meanwhile, there is no abuse of preloading, so
everybody's happy.


--
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