Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

loading frames

Status
Not open for further replies.

sqoti

Programmer
Dec 1, 2000
50
US
Ok,
I have a 3 part frameset: 2 on the left side and 1 main on the right side. A link from the left side loads into the mainpage.
**********************************
* leftframe 1 * *
*************** mainpage *
* leftframe 2 * *
* * *
**********************************

The user can click on links in the mainpage now that cause the mainpage to split into 2 frames.

Recap:
Now I have this
**********************************
* leftframe 1 * mainpageframe1 *
**********************************
* leftframe 2 * mainpageframe2 *
* * *
**********************************

User does work in mainpageframe1 that cause other stuff to load into mainpageframe1.

User has option to exit out of mainpageframe1.

I would like it to go back to the mainpage frame all by itself once the user clicks on exit causing it to look like this again.

**********************************
* leftframe 1 * *
*************** mainpage *
* leftframe 2 * *
* * *
**********************************

I cannot use history to go back, because I need to load the mainpage up with certain parameters. What I need is code that will basically href into the right side(mainpage).

I appreciate your help!
 
in your <a> tag specify the target frame.

give each of your frames a name, this way you can specify where to send the url by specfying the target property for the relevant link ie.

<frameset ...>
<frame ... name=&quot;topleftframe&quot;>
<frame ... name=&quot;bottomleftframe&quot;>
</frameset>

now in any frame in the frameset you can target a link

<a href=&quot;something.asp?param1=whatever&quot; target=&quot;topleftframe&quot;>
 
Is there a way of replacing the two frames(top and bottom) that are on the right side with one frame with content?

In my HTML, I have javascript that has if else logic in it to do window.location.href loads. I cannot seem to find an example of how to do this anywhere. I know that you can change two frames at the same time, but the examples I have seen it has different content being loaded into each frame. I want to replace two frames with one frame leaving the rest of the frames alone. Is that possible?

Thanks in advance!
 
try the following, i'm sure you will find the answer somewhere in the example below. Create the following files, past the html into them and launch main.htm. click on the link in the bottom right frame and the two frames on the right are replaced with one. Click the link in the right hand frame to return to the top right and bottom right frames:

main.htm:
<html>
<head></head>
<frameset cols=&quot;30%,70%&quot;>
<frame src=&quot;leftframeset.htm&quot; name=&quot;leftframe&quot;>
<frame src=&quot;rightframeset.htm&quot; name=&quot;rightframe&quot;>
</frameset>
</html>

leftframeset.htm:
<html>
<head></head>
<frameset rows=&quot;50%,50%&quot;>
<frame src=&quot;about:top left&quot; name=&quot;topleft&quot;>
<frame src=&quot;about:bottom left&quot; name=&quot;bottomleft&quot;>
</frameset>
</html>

rightframeset.htm:
<html>
<head></head>
<frameset rows=&quot;50%,50%&quot;>
<frame src=&quot;topright.htm&quot; name=&quot;topright&quot;>
<frame src=&quot;bottomright.htm&quot; name=&quot;bottomright&quot;>
</frameset>
</html>

topright.htm:
<html>
<head></head>
<body>
<a href=&quot;about: hello&quot; target=&quot;bottomright&quot;>send &quot;hello&quot; to bottom right frame</a>
</body>
</html>

bottomright.htm:
<html>
<head></head>
<body>
<a href=&quot;rhs.htm&quot; target=&quot;rightframe&quot;>use the whole RHS</a>
</body>
</html>

rhs.htm:
<html>
<head>
</head>
<body>
<a href=&quot;rightframeset.htm&quot; target=&quot;rightframe&quot;>restore top right and bottom right frames</a>
</body>
</html>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top