Window. Open new window full screen does not prompt to automatically close the parent window

Source: Internet
Author: User

There are already many similarArticleBut it generally only solves the problem at the time. Now, IE8 does not seem to work in the way of exiting the tab.

After testing, the following functions are used:

Function full_win (){
VaR Height = Window. Screen. availheight-33;
VaR width = Window. Screen. availwidth-10;

Window. Opener = NULL;
Window. Open ("B. aspx", "_ blank", "Height =" + height + ", width =" + width +
", Top = 0, Left = 0, toolbar = No, menubar = No, scrollbars = Yes, resizable = Yes, location = No, status = No ");
Window. Open ('', '_ Self ');
Window. Close ();
}

The result is that when the above method is called on the. ASPX page, B. aspx is automatically enabled in full screen in the new window, and A. aspx is automatically disabled without any prompts.

The key is to call window immediately after opening a new window. open ('', '_ Self'); Because IE7 and IE8 are not allowed to open windows. open window, so use window. open open a blank page in this window, and then close it.

Supplement:

After testing, directly calling the full_win function is sometimes blocked by the pop-up window of the browser.ProgramBlock;

By default, the browser will block automatically pop-up windows. Therefore, you can add an implicit link to the page and call the click method of the link to simulate user clicking.

<A id = "alogin" href = "#" onclick = "full_win ();"> & nbsp; </a>

Call

<Script language = "JavaScript"> full_win (); </SCRIPT>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.