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

REMOVE FRAMES

Status
Not open for further replies.

purpleski

IS-IT--Management
Aug 14, 2002
112
FR
Hi

I have a site that uses 3 frames:

banner - just a border at the top that does not do much
left - menu containing area
right - main content area.

I wish to put a link/button in the left frame that when clicked will remove the left and top frame and will just leave the current content of the right frame in the browser window.

In effect achieve the same as the commonly found script below but with out the need to put this or a link to it on every page.

Code:
<!-- Begin
if(top.location.href != self.location.href)
document.writeln('<A HREF=&quot;'+self.location.href+'&quot; TARGET=&quot;_top&quot;>No frames!</A>'); 
</script>

Can anybody help?

purpleski
 
Hi,

You can do this:

<A HREF=&quot;right.html&quot; TARGET=&quot;_top&quot;>NO FRAMES</A>

That will work. Just specify to link to the same page and choose the target to be _top and you are set.

I know this isn't JS but hope this might be of some use to you.

Hope this helps!
greenjumpy.gif
NATE
design@spyderix-designz.com
 
Thanks Spyderix but that doesn't work I am afraid.

banner, left and right are the names of the frames within the frameset as in

<frameset border=&quot;0&quot; frameborder=&quot;0&quot; rows=&quot;70,*&quot;>
<frame name=&quot;top&quot; scrolling=&quot;no&quot; noresize src=&quot;topframe.htm&quot; marginwidth=&quot;0&quot;>
<frameset cols=&quot;200,*&quot;>
<frame name=&quot;left&quot; target=&quot;main&quot; src=&quot;contents/contents.htm&quot; scrolling=&quot;no&quot; marginwidth=&quot;0&quot; noresize>
<frame name=&quot;right&quot; src=&quot;newsframe.htm&quot; target=&quot;_self&quot; scrolling=&quot;auto&quot; marginwidth=&quot;0&quot; noresize marginheight=&quot;4&quot;>
</frameset>

where initial page loaded is src=&quot;newsframe.htm&quot; in the right frame changes depending on the selection made from the menu contained within the left frame, which is unchanging ie the left frame always contains the page contents/contents.htm

So what I am after is a script that will look at what is in the right frame and load whatever is there at the time in to the target=&quot;_top&quot;, if you get my meaning.

Thanks and hope to hear from you.

Regards
purpleski
 
what I did was to have a HTML page (index.html say) full of links to an almost identical page (index.htm) if they are clicked they get the TARGET=&quot;_top&quot; attribute.

AND in the first page I <script> a line in the body that says parent.location.href=&quot;index.htm&quot;

The reason I still rely on links and TARGET is because of obscure, old and script-disabled browsers. This works a treat off and online in IE5.5 and needs the clicks in Netscape 4.5 in which I have probably switched off scripting. But it proves the system for both situations.

do not put the script in the secondary page or it will sit there reloading ad nauseum

It is virtually impossible to &quot;back-surf&quot; past the first page as it loads page two every time. Surfers have to use the history options. Other than that no downsides.
 
looking at cresby.com with scripting blocked may show what I do. best of luck.

Now do you know how to remove those pop-ups?
 
not quite what was asked but maybe it can be used.

Cresby
 
Sorry not quite what I need.

Thanks all the same.
 
hi purpleski,

supposing your main frame is called &quot;right&quot;, this should work:
[tt]
parent.window.top.location = parent.right.location;
[/tt] =========================================================
if (!succeed) try();
-jeff
 
Thanks for your help.

Sorry being very dumb but how should

parent.window.top.location = parent.right.location;

be put in the page: I tried

Code:
<SCRIPT LANGUAGE=&quot;JavaScript&quot;>
<!-- Begin
if(parent.window.top.location = parent.right.location)
document.writeln('<A HREF=&quot;'+self.location.href+'&quot; TARGET=&quot;_top&quot;>No frames!</A>'); 
//  End -->
</script>

but this causes and error.

Regards
purpleski
 
hi purpleski,

as a button:

<input type=&quot;button&quot; value=&quot;No Frames&quot; onclick=&quot;parent.window.top.location = parent.right.location;&quot; />


or as a link:

<a href=&quot;#&quot; onclick=&quot;parent.window.top.location = parent.right.location; return false;&quot;>No Frames</a>

=========================================================
if (!succeed) try();
-jeff
 
jeff

Thank you thank you we got there I am a fan of this forum it works.

[bigsmile]
 
glad i could help!
=========================================================
if (!succeed) try();
-jeff
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top