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
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Close Window button in jsp

  • 05-06-2007 3:37pm
    #1
    Registered Users, Registered Users 2 Posts: 1,559 ✭✭✭


    Ive tried using the code below to make a close window button in a jsp but when I press it it doesnt do anything and the window remains open.

    <form method="post">
    <input type="button" value="Close Window" onclick="window.close()">
    </form>

    It works ok with ie but wont work with firefox.


Comments

  • Registered Users, Registered Users 2 Posts: 7,468 ✭✭✭Evil Phil


    In firefox window.close() will only work for windows opened with window.open() IIRC.


  • Moderators, Politics Moderators Posts: 41,647 Mod ✭✭✭✭Seth Brundle


    JSP (and Java) is NOT JavaScript


  • Registered Users, Registered Users 2 Posts: 1,559 ✭✭✭quinnd6


    Im using javascript within a jsp and know the difference between them cheers.
    Here's something else I tried and didn't work

    <head>
    <script language="javascript" type="text/javascript">


    var browserName=navigator.appName;
    if (browserName=="Netscape")
    {
    function closeWindow()
    {
    window.open('','_parent','');

    window.close();
    }


    }
    else
    {
    if(browserName = "Microsoft Internet Explorer")
    {
    function closeWindow()
    {
    window.close();
    }
    }
    }
    </script>


  • Registered Users, Registered Users 2 Posts: 7,468 ✭✭✭Evil Phil


    I doubt you'll get anything working in Firefox.


Advertisement