Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Closing a window Javascript

  • 30-11-2006 01:22PM
    #1
    Registered Users, Registered Users 2 Posts: 8,575 ✭✭✭


    Hi,

    I have an asp page where i am trying to close the window without the user been prompted to close it.

    I have the following code
    <script type="text/javascript">
     window.close();
    </script>
    

    but everytime it runs they get a window pop up prompting them to close it.

    Can I get around this problem.

    The browser I am using is IE6

    Thanks for your help


Comments

  • Closed Accounts Posts: 522 ✭✭✭comer_97


    as far as i know you can only close a window without that message if you used javascript to open it.


  • Registered Users, Registered Users 2 Posts: 8,575 ✭✭✭Trampas


    Thanks.

    I am opening it from a VBA application


  • Registered Users, Registered Users 2 Posts: 68,173 ✭✭✭✭seamus


    Yep, afaik too, only a parent may close a child window (or a child window may close itself).


  • Registered Users, Registered Users 2 Posts: 4,475 ✭✭✭corblimey


    You could fake the window.opener value to suppress this message:
    <a href="javascript: window.opener='thiswin'; window.close();>Close</a>
    


Advertisement