Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

executing links in frames

6 views
Skip to first unread message

Leese/MJ/KP

unread,
Dec 8, 1996, 3:00:00 AM12/8/96
to

I have a page that has two frames. I need a JavaScript function in one
frame that will load a new page in the other frame.

Can anyone tell me how to do this?

Any help would be greatly appreciated.

Nils Juell

unread,
Dec 9, 1996, 3:00:00 AM12/9/96
to

> I have a page that has two frames. I need a JavaScript function in
> frame that will load a new page in the other frame.

If that's all you're want do you could just use the
target="framename" in plain html.

But if you want a function anyway you can use something like this:

<script>
function otherframe(newpage){
top.framename.location.href=newpage;
}
</script>


<a href="javascript:otherframe('new_page.html');">test</a>

where framename is the name of the frame you want to load the new page
into, and new_page.html is .... well :)

Scott Pendleton

unread,
Dec 10, 1996, 3:00:00 AM12/10/96
to

I have the same question. I want to let users select a linked item from
a dropdown list in my "menu" frame, and then have the linked item
display in the "main" frame.

Books

unread,
Dec 10, 1996, 3:00:00 AM12/10/96
to Leese/MJ/KP

Leese/MJ/KP wrote:
>
> I have a page that has two frames. I need a JavaScript function in one

> frame that will load a new page in the other frame.
>
> Can anyone tell me how to do this?
>
> Any help would be greatly appreciated.


Use the following funcion in document where the links are:

<SCRIPT LANGUAGE="JavaScript">
<!--

function update(loc1,loc2) {
parent.frames[3].location = loc1;
parent.frames[1].location = loc2;
}

//-->
</SCRIPT>

Then on the links use the followling:

<A HREF="javascript:update('readmeC.htm','readme.htm');">ReadMe</A>

When "ReadMe" is clicked, document "readmeC.htm" will load in frames[3]
and readem.htm in frames[1].

You will have to work out which frame numbers to use.

--
Books a.k.a. Chris Young
505 E. Arvada Apt. #104 719-447-1333
Colorado Springs, Co. 80906 bo...@rmi.net
http://rainbow.rmi.net/~books/

Martin said "Shall I be King?"
Amos laughed, "I have two thoughts on that, Martin. First, it's always
better to be captain than deckhand, which is why I'm a captain and not a
deckhand. Second, there's some difference between a ship and a kingdom."

_Magician Master_ Raymond E. Feist

0 new messages