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

How do I remove a frameset?

Status
Not open for further replies.

Atchett

Programmer
Dec 7, 2000
35
0
0
Hi all,

I have a page which contains two frames the top frame is the main page (with the information) and the bottom frame is logo, advert etc. I would like to be able to offer a facility for users to click on a button and close the framneset. Does anyone have any ideas? I have searched high and low but have come up with nothing so far.

Many thanks in advance.
 
hie
do you mean remove frameset & load the contents of your top frame or close your window?

1. to load a file *outside* the frameset:
<script>
//put one of these checks in ur page that is not allowed to be in frameset

//top.length is enough, but u can also use top.frames.length
if (top.length) top.location=self.location

//or

if (top.location!=self.location) top.location=self.location

</script>

2. to close browser window with frameset:
top.close();

good luck! Victor
 
Hi Victor,

Thanks for the quick response. What you have outlined isn't quite what I am looking to do. I have used what you have suggested in your reply along with another reply that you have made but unfortunately it isn't working.
Basically I have 2 frames in the window. The top frame is called &quot;Large&quot; and the bottom frame is called &quot;Little&quot;. &quot;Large&quot; contains a page from another site that I have linked to and &quot;Little&quot; contains our site logo etc. I want to be able to close &quot;Little&quot; by using a button within &quot;Little&quot;. I cannot close &quot;Little from within &quot;Large&quot; because &quot;Large&quot; contains someone elses site.

So far I have tried :-

<script language=&quot;javascript&quot;>
<!--Hide
function closeFrame()
{
if (top.location!=self.location) top.location=top.frames.Large.location
}
// End Hide -->
</script>

and this does nothing and yet when I tried :-

<script language=&quot;javascript&quot;>
<!--Hide
function closeFrame()
{
if (top.location!=self.location) top.location=top.frames.Little.location
}
// End Hide -->
</script>

I was getting just &quot;Little&quot; displayed on the screen.

When I tried :-
<script language=&quot;javascript&quot;>
<!--Hide
function whatFrame()
{
var Large1 = top.frames.Large.location;
var Little1 = top.frames.Little.location;
alert(&quot;Large =&quot;+ Large1 +&quot; and Little = &quot;+ Little1);
}
// End Hide -->
</script>

I was getting the URL of &quot;Little&quot; but no URL for &quot;Large&quot; (which is what I need!). I'm confused! Any ideas?

Many thanks in advance.
 
yeah, you have to get &quot;permission denied&quot; error, right?
but you have set this url yourself? if u did, you might create a hidden field in your document (in your 'little' frame) & fill it with url that you are assigning to 'large' frame

r you still with me?

then, when you whant to get rid of frameset, don't try to get the url of frame, wich document is from another domain, but get those url from your own hidden text field..

hope you got it, try & tell me if it is workable for you; if not - well, what can i say, there are a lotta people who would help you if i wont :)) Victor
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top