Re: A simple Question

Peter Belesis (peter@webreference.com)
Mon, 18 Aug 1997 21:25:18 +0300


Message-Id: <33F8938E.519C@webreference.com>
Date: Mon, 18 Aug 1997 21:25:18 +0300
From: Peter Belesis <peter@webreference.com>
To: "GaRgL..." <GaRgL@WorldNet.Net>
Cc: Peter Flynn <pflynn@imbolc.ucc.ie>, stratos@dnn.gr, www-html@w3.org
Subject: Re: A simple Question

GaRgL... wrote:

> here's the script
> 
> <SCRIPT LANGUAGE="JavaScript">
> <!--
> 
> function DoubleUpdate ( First , Second )
>   {
>   parent.frameone.location.href = First
>   parent.frametwo.location.href = Second
>   }
> 
> //-->
> </SCRIPT>
> 
> you can call it like this <A
> HREF="JavaScript:DoubleUpdate('firstlink','secondlink')"></A>
> 
> oh, by the way, there is a NASTY bug between explorer/navigator...
> explorer takes relative links from the point of the frame you want to
> update while navigator takes the frame from which you call the script...
> 

Actually, this question was addressed extensively this morning, Europe
time, but not posted to group as it is outside of usual concerns.

In any case, I wrote the following, which I believe is the most elegant
and I've tested on both NS3 and IE4. No SCRIPT tag or script URL is
necessary. It can all be done in the document with the addition of a 
single event handler. *location* could be *location.href*. 
--------------------

to update frames 2 and 3 from frame 1 in a frameset:

<A 
HREF="fourth.html" TARGET="frSecond" onClick="parent.frThird.location =
'fifth.html'">Load 2 other frames</A>

to update frame 2 and 3 from frame 2 in a frameset:

<A 
HREF="third.html" TARGET="frThird" onClick="location =
'second.html'">Load over me and the third frame</A>

or some variation.

-- 

Peter Belesis            Dynamic HTML Lab
peter@webreference.com   http://www.webreference.com/dhtml