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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

loading/unloading frames 1

Status
Not open for further replies.

santanudas

Technical User
Mar 18, 2002
121
GB
Hi,
I need a help. I got a page with nested frame set, like this:

<FRAMESET rows="59,*" cols="99%" frameborder="0">
<FRAME name="titlebar" src="header.html">
<FRAMESET cols="190,99%" rows="*" frameborder="0">
<FRAME src="leftbar.html" name="leftbar" noresize>
<FRAME src="rightbar.html" name="rightbar" noresize>
</FRAMESET>
</FRAMESET>

There is a link on the first frame, which opens a new page. The thing I want to do is to unload the last two frames (in the second frameset) when the link is clicked and to put the new page there. Can anybody please help me to do that?

Thanks in advance.
 

Hi, sorry, the target="_parent" actually not working the way I want it to be. I want to keep the first frame (the very top one) to be unchanged and want the next two nested frames to be replaced with a new page. target="_parent" replacing the all three frames and putting the new page there. I certainly don't want that. Any further suggestion(s)?
 
CliveC,

how is targeting a new frameset supposed to load two frames when one link is clicked, without using javascript?



-jeff
try { succeed(); } catch(E) { tryAgain(); } finally { rtfm(); }
i like your sleeves...they're real big
 
In your main document, include:
Code:
<FRAMESET rows="59,*" cols="99%" frameborder="0">
  <FRAME name="titlebar" src="header.html">
  <FRAME name="main" src="mainFrameset.html">
</FRAMESET>

Then, in a new document called "mainFrameset.html" include:
Code:
<FRAMESET cols="190,99%" rows="*" frameborder="0">
  <FRAME src="leftbar.html" name="leftbar" noresize>
  <FRAME src="rightbar.html" name="rightbar" noresize>
</FRAMESET>

Finally include target="main" in your links:
Code:
<a href="newPage.html" target="main">
You can load the left and right frames again using:
Code:
<a href="mainFrameset.html" target="main">

Adam
 
CliveC, I have to question your solution too. Are you suggesting that the easiest way is to create a new frameset for each page you want to load? I'd have to disagree.

Adam
 
The best solution depends a lot on what the application does. If it starts with 3 frames but subsequently only has two then adam's is a good solution.

The problem arises if you subsequently want to target one or more of the two bottom frames.

By reloading a new frameset (target="_top") you may have a similar header frame but with links appropriate to the frameset within which the header is contained.

The only extra overhead is reloading the header frame, which might be necessary anyway.

It is always helpful if the originator posts some code.

Clive
 
The problem is that frames and JS are both the spawns of satan. There has to be an easier way to o whatever it is your trying to accomplish -- unless what your trying to accomplish is scaring away your visitors. The problems with frames has been ranted about many times before, please read some of my earlier frame and/or JS rants before considering either solution presented. Given the choice, creating different framesets is the way to go for several reasons:

If I turn off JS, I can't use your page.
JS links aren't spidered by Google and other engines.
JS is EVIL.

[plug=shameless]
[/plug]
 
Code:
The problems with frames has been ranted about many times before

Unfortunately, the soulutions haven't.
There is a solution for every frame problem that has ever been presented in this forum.

Frames are not an instument of Satan, they are just another tool that may or may not be appropriate for the task at hand.

Clive
 
<flameProofSuit>
Problems with frames:
1.) People, in the general public, think frames are evil because the past abuse. Using frames risks losing vistors over silly reasons. Solution: ignore vistor preference for developers, as web developers oft' do.
2.) Lynx and most other text browsers don't render frames, instead the user us given the noframes text (if the site designer did a good job and gave all the content in the noframes all is well, if not the user has to go to the pages seperatly and has a hard time navigating because navagation frame is seperate from the content frame -- you lose more vistors).
Solution: post signs say "require XYZ latest browser" and call anyone who happens to use a text based/speaking/mobile browser a loon in the minority whose visit (and money) we obviously don't need or want.
3.) Most fram problems are inereint in the want for a frame. In this respect the solution to all "frame problems" is to abondon them.
Solution: Use a frame.
</flameProofSuit>

[plug=shameless]
[/plug]
 
jstreich,

i agree that frames are lame, but #2: who the fsck these days is using a text-only browser?


-jeff
try { succeed(); } catch(E) { tryAgain(); } finally { rtfm(); }
i like your sleeves...they're real big
 
i agree that frames are lame, but #2: who the fsck these days is using a text-only browser?
Old linux fogies, cellphone webbrowsers, other mobile technology, visually impaired people who use spaking browsers and spiders (well if you can call the last two of them "text only" -- although it is true that both have an easier time with things that display well in a textonly browser).

[plug=shameless]
[/plug]
 
jstreich, these problems have been discussed before.

1. The general public would not necessarily know whether they were in a frameset or not.

2. A noframes tag should refer to a link (usually the navigation frame) which would not be a problem at all.

Framesets are perfect for handheld and noframe devices. Read faq215-5692.





Clive
 
Frames and JavaScript are not evil, they're just used too often by evil people. The evil developer will make a page with a bunch of frames. The smart developer will use them sparingly, if at all. The evil developer will make the web page dependent on JavaScript. The smart developer will make it work without JavaScript first, then use JavaScript to enhance it. You can make arguments like these with any technology. Don't blame the technology, blame the stupid people who do stupid things with it.

Adam
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top