...

View Full Version : close this window



phunkymunkie
06-20-2004, 11:25 PM
hi sorry if this is in the wrong place, i wasnt sure.
How do i make a link that closes the browser window?

thanks

Mr J
06-21-2004, 12:07 AM
<a href="#null" onclick="self.close()">Close me</a>

phunkymunkie
06-21-2004, 12:22 AM
thankyou please :thumbsup:
much appreciated

phunkymunkie
06-21-2004, 01:03 PM
Sorry i've just realised thats not working, because the page is part of a site that uses frames. Is it possible to closee the window when the page really a frame within a page?

(click here (http://www.ousedale.tk) to see the site in question)

Mr J
06-21-2004, 03:38 PM
You cannot "close a window" if it is part of a frameset

phunkymunkie
06-21-2004, 03:41 PM
ok thanks anyway :o

Mr J
06-21-2004, 08:29 PM
Or do you mean to close the frameset?

boeing747fp
06-21-2004, 08:50 PM
try <a href='javascript:window.close();' target='_parent'>Close Window</a>

like this http://boeing747fp-server2.com/all.html

Mr J
06-21-2004, 10:04 PM
I usually use

<A href="#null" onclick="parent.close()">CLOSE WINDOW</A>

But if you get the proverbial message

The webpage you are viewing is trying to close the window.
Do you want to close this window?

then use

<A href="#null" onclick="parent.opener = top;parent.close()">CLOSE WINDOW</A>

phunkymunkie
06-21-2004, 11:36 PM
yes.. thats what i'm talking about!! sorry i worded it so badly!
thanks sooo much for the help.

You guys have infact almost impressed me as much as wayne rooney did tonight (any england football supporters will know what im on about!) :cool:

Cheers

Willy Duitt
06-22-2004, 03:11 AM
yes.. thats what i'm talking about!! sorry i worded it so badly!
thanks sooo much for the help.

You guys have infact almost impressed me as much as wayne rooney did tonight (any england football supporters will know what im on about!) :cool:

Cheers

I know who Andy Rooney is, but I doubt that will help you close a parent window you did not open.

phunkymunkie
06-22-2004, 09:23 AM
haha dont worry about it then

glenngv
06-22-2004, 09:52 AM
haha dont worry about it then
You'll worry it (closing the parent window without security alert) when the bug is fixed. It is because Mr J's second suggestion is a bug exploit. :p



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum