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 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Oct 2002
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Is alert box required when using "javascript:window.close()"

    I am using a graphic link with "javascript:window.close()" in order to close a window. However, I don't want the box to pop up that says "the browser is trying to close the window. doyou want it to" or whatever the text is.

    Is there any way to get rid of that prompt?

  • #2
    Smokes a Lot
    Join Date
    Jul 2003
    Location
    CA, USA
    Posts
    1,594
    Thanks
    5
    Thanked 20 Times in 20 Posts
    I don't think so. For security purposes, I believe the only time it won't appear is if through the code, your page is the one that opened the window.

    Basscyst
    Helping to build a bigger box. - Adam Matthews

  • #3
    Senior Coder
    Join Date
    Jun 2002
    Location
    ColoRockyz
    Posts
    1,646
    Thanks
    1
    Thanked 0 Times in 0 Posts
    See if this works:

    <script>
    function bye() {
    self.opener = this;
    self.close()
    }
    </script>
    </head>
    <body>
    <img src="hat.gif" onclick="bye()">
    Zoobie or not Zoobie...That is the problem.
    <body onUnload="flush( ! )">

  • #4
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,030
    Thanks
    0
    Thanked 247 Times in 244 Posts
    That is a bug exploit, so you can't rely on it to work in future releases.
    closing a window from another page


  •  

    Posting Permissions

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