Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Closing a window Javascript

Options
  • 30-11-2006 1:22pm
    #1
    Registered Users Posts: 7,677 ✭✭✭


    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 Posts: 7,677 ✭✭✭Trampas


    Thanks.

    I am opening it from a VBA application


  • Registered Users Posts: 68,317 ✭✭✭✭seamus


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


  • Registered Users 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