Close Web Page DIalog

Posted on 2011-10-12
Last Modified: 2012-05-12
I have a java script that closes the browser window.
 function win_close() {
   window.opener = top;

However...I get the close window dialog as well

Any way I can bypass the dialog?
Question by:lrbrister
    LVL 28

    Expert Comment

    Just to clarify, when you close a javascript window to get back to the parent - opener - window, you get the navigation alert?

    If that is the case, you simply have to remove the "onbeforeunload" function from the child page.

    If this function is integrated into a template or something, then you will need to pass a javascript variable or querystring parameter to disable this method when it is a child window.

    Author Comment

    I should have been clearer

    I have a web page that is the middle page (#2) in a series of 3

    At the pont of click on page 2 button...

    I want to close the page I'm on (middle page)  with no dialog while opening a popscreen (which has limited menu etc)

    All the while, the original web browser is open.
    LVL 28

    Accepted Solution

    So you would remove the onbeforeunload from #2 and simply call the followed by a window.close() on #2.

    Author Closing Comment


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
    Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
    The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
    This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA.…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now