Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 13 of 13
  1. #1
    New Coder
    Join Date
    Jun 2004
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    close this window

    hi sorry if this is in the wrong place, i wasnt sure.
    How do i make a link that closes the browser window?

    thanks

  • #2
    Senior Coder
    Join Date
    Aug 2002
    Location
    UK
    Posts
    2,789
    Thanks
    2
    Thanked 14 Times in 14 Posts
    <a href="#null" onclick="self.close()">Close me</a>

  • #3
    New Coder
    Join Date
    Jun 2004
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thankyou please
    much appreciated

  • #4
    New Coder
    Join Date
    Jun 2004
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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 to see the site in question)

  • #5
    Senior Coder
    Join Date
    Aug 2002
    Location
    UK
    Posts
    2,789
    Thanks
    2
    Thanked 14 Times in 14 Posts
    You cannot "close a window" if it is part of a frameset

  • #6
    New Coder
    Join Date
    Jun 2004
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ok thanks anyway

  • #7
    Senior Coder
    Join Date
    Aug 2002
    Location
    UK
    Posts
    2,789
    Thanks
    2
    Thanked 14 Times in 14 Posts
    Or do you mean to close the frameset?

  • #8
    Regular Coder
    Join Date
    Oct 2003
    Posts
    603
    Thanks
    2
    Thanked 1 Time in 1 Post
    try <a href='javascript:window.close();' target='_parent'>Close Window</a>

    like this http://boeing747fp-server2.com/all.html
    Last edited by boeing747fp; 06-21-2004 at 07:53 PM.

  • #9
    Senior Coder
    Join Date
    Aug 2002
    Location
    UK
    Posts
    2,789
    Thanks
    2
    Thanked 14 Times in 14 Posts
    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>

  • #10
    New Coder
    Join Date
    Jun 2004
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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!)

    Cheers

  • #11
    Banned
    Join Date
    Sep 2003
    Posts
    3,620
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by phunkymunkie
    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!)

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

  • #12
    New Coder
    Join Date
    Jun 2004
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    haha dont worry about it then

  • #13
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,068
    Thanks
    0
    Thanked 256 Times in 252 Posts
    Quote Originally Posted by phunkymunkie
    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.
    Last edited by glenngv; 06-22-2004 at 08:54 AM.
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •