Hi Suz,
Take a look at:
http://infusiondesign.com/examples/js_frame_switch.html
I think this what you're trying to do. Here's the guts of the code:
In the top level frameset html:
<script language = "javaScript">
<!--
function changePages() {
var A = parent.A.location.href
var B = parent.B.location.href
parent.A.location.href=B
parent.B.location.href=A
}
// -->
</script>
The two frames and frame filenames are named like this:
<frame name="A" src="A.html">
<frame name="B" src="B.html">
This code is on the clickable link on each frame page:
<A HREF="javaScript:onClick=parent.changePages()">click text</a>
You will need to change some things so you can use your own filenames and
frame names, like this:
<script language = "javaScript">
<!--
function changePages() {
var A = parent.yourframenameA.location.href
var B = parent.yourframenameB.location.href
parent.yourframenameA.location.href=B
parent.yourframenameB.location.href=A
}
// -->
</script>
and
<frame name="yourframenameA" src="yourfilenameA.html">
<frame name="yourframenameB" src="yourfilenameB.html">
If you have more than 2 frames in the frameset, replace the word "parent"
with the word "top" in all places and you should be OK.
All code is also viewable using view source.
Jack
> Jack wrote:
>
> >No gaurantee's, but try:
> >function changePages('guestbooknav.html','guestbook.html') {
> >or
> >function changePages("guestbooknav.html","guestbook.html") {
>
>
> Hi Jack and gang,
>
> I tried the second version (with double quotes) yesterday and got either
> the same or a similar error ("missing ) after formal parameters" that with
> an arrow that points to the dot in guestbooknav.html )
>
> I finally resorted to loading a whole new frameset, but I don't like the
> way it flashes as it loads and would like to figure this out.
>
> The instructions in Heinle's book are rather cryptic. He doesn't even say
> which page to put the Javascript on, so I just assumed it needed to be on
> the main frameset page. Here is exactly what he says:
>
> ******************************************************************
> **************
> ********
>
> "Not surprisingly, there is a little Javascript code involved in changing
> the location of multiple frames. Figure 3-9 shows a function (called
> changePages() ) for changing two frames with one click:
>
> Figure 3-9:
>
> function changePages(toolbarURL, mainURL) {
> parent.toolbar.location.href=toolbarURL;
> parent.main.location.href=mainURL;
> }
>
> [Figure 3-10--which I haven't included--shows the function for changing
> three frames with one click]
>
> "This changes the locations of both the 'main' frame and the 'toolbar'
> frame when you pass it through the appropriate URLs. For example,
> to change
> the location of the 'toolbar' frame [my single quotes represent
> italics] to
> 'toolbar_document2.htm' and the location of the 'main' frame to
> 'main_document2.html' create a link with the Javascript
> pseudoprotocol that
> runs the 'changePages()' function:
>
> <A
> HREF="javascript:changePages('toolbar_document2.html','main_docume
> nt2.html'):
>
> *
> ******************************************************************
> **************
> *******
>
> Suz
>
>
> Suzanne Stephens, Dave Stephens Design; Ashland, Oregon
> 541-552-1190, 541-1192 http://www.KickassDesign.com/
> CyberCircus Grand Prize Winners http://www.thecybercircus.com/
> Web Page Design for Designers: http://www.wpdfd.com/wpdres.htm
> Clip Art: http://www.freeimages.com/artists/
> Tender Loving Care Interactive DVD movie: http://tenderlovingcare.cc/
>
>
> ____________________________________________________________________
> --------------------------------------------------------------------
> Join The Web Consultants Association : Register on our web site Now
> Web Consultants Web Site : http://just4u.com/webconsultants
> If you lose the instructions All subscription/unsubscribing can be done
> directly from our website for all our lists.
> ---------------------------------------------------------------------
>
____________________________________________________________________
--------------------------------------------------------------------
Join The Web Consultants Association : Register on our web site Now
Web Consultants Web Site : http://just4u.com/webconsultants
If you lose the instructions All subscription/unsubscribing can be done
directly from our website for all our lists.
---------------------------------------------------------------------