PDA

View Full Version : How to refresh and update a frame from another one?


BigDaddy
01-03-2003, 02:42 PM
Hi. I have been put in charge of finishing up adding some navigation to a site. I generally only deal with ASP, and very little javascript, so I thought I'd ask the experts. :)

Anway, the page is layed out as 1 frame on top with information, and an image. The bottom 3/4 of the page is 1 page, divided into 2 seperate frames, 1 on the left for the menu, and the other one on the right for content.


top content
_____________
side content | main content
|

I think you get the point. Anyway, my problem is that when you click on certain items on the menu, I want to refresh the top content, and then either include or not include information, depending on what is in the main content window--what page is displayed.

Any ideas? I appreciate any help offered. Thanks.

Shecky
01-03-2003, 04:09 PM
name your frames like this
<frame name="whatever">

Then just set your target frame for each link like this
<a href="someurl.html" target="whatever">text</a>

finally a question easy enuff for me to answer! yay!:)

BigDaddy
01-03-2003, 05:44 PM
Originally posted by Shecky
name your frames like this
<frame name="whatever">

Then just set your target frame for each link like this
<a href="someurl.html" target="whatever">text</a>

finally a question easy enuff for me to answer! yay!:)

That, I know. What I was curious was how to refresh the top frame if certain menu items on the left are clicked on, along with changing the content of the main content frame. So...the one link would basically update 2 frames.

Shecky
01-03-2003, 07:01 PM
if you want a certain top frame to show every time a certain main frame is displayed, add a
<body onload="window.framename.location='corrisponding.html'">

or to a single link you could change two frames like this:
<a href="main2.html" target="mainframe
onClick="window.top.location='top2.html'">
link</a>

Then again i'm not very smart so that might not work :-P

Shecky
01-03-2003, 07:20 PM
mabye its onload/onclick="framename.location.href='url.html'"

BigDaddy
01-04-2003, 01:18 AM
I'll try that, probably, to at least get the site up and running, but I think I'm going to dump the frames and just use ASP include files.