Greetings. I'm Webmaster for a Boy Scout Troop website
(www.troop606.org). I'm a fairly compitent Perl hack, but I'm weak on
the JavaScript side.
My site is composed of a set of three frames: 'banner', 'menu', and
'main'. Currently, only 'main' ever changes.
My 'menu' frame loads "menu.cgi," a simple CGI.pm Perl script. I
dislike my 'menu' frame for two reasons: one, it's butt-ugly, and,
two, it doesn't give any indication of the currenly-selected page.
So I've written another menu .cgi program that I like MUCH better,
which simulates folder tabs and indicates the current page. Have a
look at these examples:
http://troop606.org/cgi-bin/menu2.cgi?content=Home
http://troop606.org/cgi-bin/menu2.cgi?content=Photos
http://troop606.org/cgi-bin/menu2.cgi?content=About
Now, all I need to do is to replace the menu frame (menu.cgi) with the
new-and-improved menu (menu2.cgi).
But, to do that, the <a> links in menu2.cgi need to be replaced with a
little bit of javascript to open two .cgi programs in two frames -
(one) to reload the menu.cgi in the 'menu' frame and (two) to open the
designated target in the 'main' frame. And I'm not sure how to do
that.
The answer seems very simple. I found some code at
http://javascript.internet.com/navigation/load-two-frames.html, which
ALMOST does what I want, but it loads into a new window. My clock
tells me that's it's 1:43 am localtime and I'm too tired to figure it
out, so I pose the question to those who know JavaScript much better
than I.
All of my code is available from "view source" on my web-links, so I
won't bother to replicate it here. A suitable answer would specify
the syntax of the <a> links in menuX.cgi as well as any bit of code
that belongs in the HEAD section of any document to make this work.
Tnanks! |