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

Close a frames page with javascript

Status
Not open for further replies.

philksr

Programmer
Apr 27, 2001
13
Does anyone have a javascript that can close a frames page? I've used <a href=&quot;javascript:window.close()&quot;>Close Window</a> but can't make it work on a frames page. My page has two frames.
 
you want to close one of the frames? you have a popup that you want to close and that popup has frame?

the first one just do this

<a href=&quot;link.htm&quot; target=&quot;_top&quot;>open in whole window</a>

the second one

<div onclick=&quot;window.top.close()&quot;>click here to close</div>

sometime you just gotta say &quot;WHAT THE @#*% !!&quot;
 
Actually, I have a link on a website that opens a new window over that page. The new window is a frames page with two frames. I want the user to be able to click on a link and have the frames window close entirely.
 
yes if you read my reply and tested it out you would see that #2 is your solution for the link

sometime you just gotta say &quot;WHAT THE @#*% !!&quot;
 
try this:
<a href=&quot;javascript:parent.frames.close()&quot;>Close Window</a>

Known is handfull, Unknown is worldfull
 
Works Great! I swear, if I asked you guys the secret of the universe, you probably could come up with an answer in about 10 minutes.

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top