Click to See Complete Forum and Search --> : redirect into a different frame


pcs800
01-16-2003, 12:08 PM
I have a page with 3 frames, when a button on the top frame is clicked, it loads a page into the middle frame, in turn i would like the middle page to cause another to load in the botton frame.
how can i do this with java script?
I've already got the top two frames working, so the code i need will be placed into the middle frame.

pcs800
01-16-2003, 12:19 PM
I forgot to mention I am new at this, and have generally been using copy and paste codes wherever i can find them.
Also, is there an html command to load another frame on pageload?

pyro
01-16-2003, 12:34 PM
I think this might be what you are looking for. http://forums.webdeveloper.com/showthread.php?s=&threadid=1941

pcs800
01-16-2003, 02:24 PM
Thanks for the reply, but this is not what i am trying to do.
I will try to explain more clearly (I am not great at explaining in the first place)
Say you have a web page that consists of two frames (we'll skip the 3rd one from earlier)
Top frame contains stuff.htm
Bottom frame contains nothing (at first)
Entire page is called index.htm
When i go to www.mysite.com/index.htm
The top frame loads stuff,htm, the bottom frame loads nothing.
I would like the code to be placed into stuff.htm that tells the bottom frame to load morestuff.htm

I have figured out how to do it with flash, but not using java code. I know it must be simple, because i have used one or two line cods for redirecting a page. And it seems that this would be the same thing, accept with a target=bottom or something to that effect.

pyro
01-16-2003, 02:33 PM
Maybe this?

top.framename.location = "yoururl.htm";

pcs800
01-16-2003, 02:52 PM
Thanks Pyro, that looks like it will work. BUT, i am no java code writer, I would need the entire code (excluding my own links) to be able to use it.
I am trying to learn to write it though, so i don't have to rely on other peoples codes.
I will use the flash file i created to do the job until i learn to create java scripts on my own.
Thanks again, I will be back the next time i need help.

fredd
01-16-2003, 09:23 PM
This might work for you.

<!-- TWO STEPS TO INSTALL FRAME NAVIGATION (FRAMESET):

1. Put the code into the HEAD of your frames HTML document
2. Copy the frameset code and give each frame a name -->

<!-- STEP ONE: Copy this code into the HEAD of your FRAMESET page -->

<HEAD>

<SCRIPT LANGUAGE="JavaScript">

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
function frameNavig() {
frames['right'].window.location="next-page.html";
}

// 'right' in the line above is what frame you want to change
// it can be either of the frame names you define below

// End -->
</SCRIPT>

<!-- STEP TWO: Copy this FRAMESET code into your FRAMESET page -->

<frameset cols="50%,*" framespacing=0>
<frame name="left" src="your_left_page.html">
<frame name="right" src="your_right_page.html">
</frameset>

<!-- STEP THREE: Give each frame a name! (frame name="left") -->

<p><center>
<font face="arial, helvetica" size="-2">Free JavaScripts provided<br>
by <a href="http://javascriptsource.com">The JavaScript Source</a></font>
</center><p>

<!-- Script Size: 0.99 KB -->

To see demo and sample code, goe here: http://javascript.internet.com/navigation/frame-navigation.html

pcs800
01-16-2003, 10:08 PM
Cool, thanks! I will try it out tonight.
The Flash thing is working, but kinda picky about it's space on the pages face.
I will post here again after i try it.

pcs800
01-16-2003, 10:23 PM
ok, i tried it, does not seem to be what i need.

If you would like to view what i am doing, the address is http://www.bargainmonkey.com/newtbm/index.htm

If you look closely at the page, (or open it in your editor) the top nav bar tells the frame below it what page to load, therefore displaying relevant links. (we'll call this the bottom nav bar)

As the selected bottom nav bar loads, i would like it to direct the frame below it, to load a given url. (total of 3 frames on the page, all horizontal)

It works now, but the second bar is made with flash to get the effect i am looking for.

The above url is not permanent, it is for test purposes only. The sites current config. can be seen at http://www.bargainmonkey.com

I really appreciate your help Fredd, and Pyro.
Post a link here, and i will put it on my site.

pyro
01-16-2003, 10:37 PM
One other thing I thought of is that you could have two framesets. The first one sets the top and the bottom. The top is what you got now, and the bottom is a new frameset. Then, in your new frameset, the top is your middle frame, and the bottom is the bottom frame. Just a thought. :)