Re: Javascript and frames - simplify navig for users

Subject: Re: Javascript and frames - simplify navig for users
From: Kris Olberg <kjolberg -at- IX -dot- NETCOM -dot- COM>
Date: Wed, 2 Jul 1997 14:43:59 -0500

I duplicated this set up and found this workaround. Put the following
coding (or something similar) in the welcome.htm file:

----------------start of WELCOME.HTM ---------------
<HTML>
<BODY>
<p>...vital information in the
<script language="JavaScript">
if (parent != 'cible')
document . writeln("<a href='cws.htm'>Benefits report</a>");
else
document . writeln("<a href='cws.htm' target='cible'
onclick='parent.frames[0].location'='list.htm''>Benefits report</a>");
</script>
<p>...continue on with body of welcome.htm file.
</BODY>
</HTML>
----------------end of WELCOME.HTM ---------------

Make sure to put lines starting with "document . writeln ..." all on a
single line in the HTM file. Otherwise you'll get more JS errors.

What this coding does is detect the context of the welcome.htm file. If the
welcome.htm file is not in the cible frame (i.e., parent != cible), the
link is a simple link to cws.htm Otherwise, the link contains the target
attribute, onClick event handler, etc.

BTW, if you cut and pasted stuff just as it appears in source files, you
have some minor HTML and JavaScript syntax problems. I cut and pasted stuff
from your original mail and found missing </frameset> tags, etc.)

Let me know if you need anything else.

Regards...Kris
-------------------------
kolberg -at- actamed -dot- com
kris -at- olberg -dot- com

----------
> From: John Trollope <John_Trollope -at- WATSONWYATT -dot- COM>
> To: TECHWR-L -at- LISTSERV -dot- OKSTATE -dot- EDU
> Subject: Javascript and frames - simplify navig for users
> Date: Wednesday, July 02, 1997 10:45 AM
>
> Kris et al,
>
>
> >In what context does the link fail? When welcome.htm is loaded
> >into one of the other frames (i.e., list_of_files or navbar)?
> >Or when welcome.htm is loaded into frameless window?
>
> When it is in a frameless window.
>
> Oh, I forgot to mention my other workaround: I just create a frame
> definition set for each link. That is to say,
>
> --BEGIN extract of FrameHR.htm--
> <frameset cols="25%,*" border="1" bordercolor="#0033CC">
> <frame src="list.htm" name="list_of_files">
> <frame src="launder.htm" name="cible">
> --END extract of FrameHR.htm--
>
> However this is not very practical as hundreds of these files will need
to be
> created.
>
>
> ----------
> > From: John Trollope <John_Trollope -at- WATSONWYATT -dot- COM>
> >
> > 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'.
>
> This=
>
> --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--
>
>
>
>
> Cheers,
> John
>
> John_Trollope -at- Watsonwyatt -dot- com (w)
> john -dot- trollope -at- easynet -dot- co -dot- uk (h)
>
> http://easyweb.easynet.co.uk/~john.trollope/scripts/
> Javascripts for technical communicators and translators
>
> 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

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: HELP:Acronym/ Glossary page numbers
Next by Author: Re: Design of GUI/Web Application Interfaces -- UIE's Web SiteUsability Report
Previous by Thread: Javascript and frames - simplify navig for users
Next by Thread: Screen dumps into online help


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


Sponsored Ads