Javascript and frames - simplify navig for users

Subject: Javascript and frames - simplify navig for users
From: John Trollope <John_Trollope -at- WATSONWYATT -dot- COM>
Date: Tue, 1 Jul 1997 17:17:34 -0700

Hello.

I have a script which allows me to maintain the frame structure when I link to a
file. This letter will show you how to do it and then ask if there is a better
way of doing it. I am assuming you are familiar with Netscape frames.



--MY http://develop/hr/INDEX.HTM file--

<html><head>
<frameset rows="55,*" border="1" bordercolor="#0033CC">
<frame src="/common/navig.htm" name="navbar">
<frame src="bottom.htm" name="bottom">
</html></head>

--END MY http://develop/hr/INDEX.HTM file--


--MY http://develop/hr/BOTTOM.HTM file--

<frameset cols="25%,*" border="1" bordercolor="#0033CC">
<frame src="list.htm" name="list_of_files">
<frame src="welcome.htm" name="cible">
</html></head>

--END /MY http://develop/hr/INDEX.HTM file--


In my (http://develop/hr/welcome.htm) file, I need to link to a Benefits report
(http://develop/benefits/cws.htm) *and* display the benefits/list.htm in the
"list_of_file" frame.

--BEGIN INCORRECT LINK IN EXCERPT of http://develop/hr/welcome.htm--
...vital information in the <a href="http://develop/benefits/cws.htm";>Benefits
report</a>
--END--



--BEGIN CORRECT LINK IN EXCERPT of http://develop/hr/welcome.htm--
...vital information in the <a
href="http://develop/benefits/cws.htm"; target="cible"
onclick="parent.frames[0].location='benefits/list.htm'">Benefits report</a>
--END--


This is fine and dandy *if the page is loaded into the correct frames*. If
hr/welcome.htm is not in the frame named "cible", you'll get the following
error:

Javascript Error: http://develop/hr/welcome.htm
Window[0] has no property named 'location'.

Does anybody know a workaround? I want to use this script, but I fear all the
calls our technical support will receive when our users get this error.

Cheers,
John

P.s. I'll put the solution onto my Javascripts for technical communicators and
translators web page at http://easyweb.easynet.co.uk/~john.trollope/scripts/


john_trollope -at- watsonwyatt -dot- com (w)
john -dot- trollope -at- easynet -dot- co -dot- uk (h)

TECHWR-L (Technical Communication) List Information: To send a message
to 2500+ readers, e-mail to TECHWR-L -at- LISTSERV -dot- OKSTATE -dot- EDU -dot- Send commands
to LISTSERV -at- LISTSERV -dot- OKSTATE -dot- EDU (e.g. HELP or SIGNOFF TECHWR-L).
Search the archives at http://www.documentation.com/ or search and
browse the archives at http://listserv.okstate.edu/archives/techwr-l.html


Previous by Author: Re: Contents at a Glance
Next by Author: Javascript and frames - simplify navig for users
Previous by Thread: help: topic title phrasing (long, sorry!)
Next by Thread: Re: Javascript and frames - simplify navig for users


What this post helpful? Share it with friends and colleagues:


Sponsored Ads