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 a Frame

Status
Not open for further replies.

westcoaststyle

Programmer
Joined
Oct 15, 2001
Messages
81
Location
US
Ok, I have a top frame in a set of two (top and bottom). I want to have a link in the top frame that, when clicked, removes the frame to leave the bottom frame only.

The code I was using I found on this site:
Code:
<a href=&quot;javascript:document.location=bottom.document.location&quot; target=&quot;_top&quot;>remove frame</a>

I tried modifying it and used this too:
Code:
<a href=&quot;#&quot; onMouseover=&quot;window.status='close this frame';return true;&quot; onClick=&quot;document.location='bottom.document.location'&quot; target=&quot;_top&quot;>remove frame</a>

but, what it's doing is making the whole page the top frame instead of the opposite.

The frames page looks like this:
Code:
<frameset framespacing=&quot;1&quot; rows=&quot;20,*&quot;>
  <frame name=&quot;top&quot; scrolling=&quot;no&quot; noresize target=&quot;bottom&quot; src=&quot;musiccontrol.htm&quot; marginwidth=&quot;0&quot; marginheight=&quot;0&quot;>
  <frame name=&quot;bottom&quot; src=&quot;index2.htm&quot;>

You can see it in action at
Thanks!!
 
No good. It trys to connect to a site with the URL javascript://
 
here it is:

<a href=&quot;#&quot; title=&quot;close this frame&quot; onClick=&quot;top.location.href=parent.bottom.location.href&quot;>close this frame</a>

&quot;top&quot; is a javascript-reserved word that corresponds to the top-most browser window, therefore it is not recommended to call anything on your page with this name.

good luck
 
Ok, what I've done now is this:
Code:
<a href=&quot;javascript:document.location=bottom.document.location&quot; onMouseover=&quot;window.status='close this frame';return true;&quot; target=&quot;_top&quot;>remove frame</a>

and what's odd is that it works locally, but when I put it on the server and connect to use it, it doesn't work.

What's the deal???
 
Starway: Cool! That works.

Now, the one other thing is: when I remove the frame, I lose my domain name in the address bar - it shows the full url including the IP addy. I have the URL keeper on on my domain name, but it's not working when I remove the frame.. any ideas?

Thanks a lot for your help!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top