# javascript to close frame



## mreks (Jan 31, 2003)

hi -

I'm wondering if anyone has figured out a way to close one frame in a frameset (one frame will have a link to close itself). And this has to work if the frames are loading files from different servers/domains.

have tried this, and some variations, from a frame called nav with frame named content:


<A HREF="#" onclick="top.location.href=top.content.location.href;return false">close this frame<A>


but it only works when both frames are laoding files from the same server...

i am stumped.


----------



## TommyWillB (Feb 2, 2003)

There is no such thing as "closing" a frame. 

If you want to make a frame go away, then you need to reload a new frameset url into the parent frame.

Use something like this: 
	
	



```
<A HREF="frameset.html" target="_parent">close this frame<A>
```


----------

