Let Window.close not prompt: The webpage you are viewing is trying to close the window. Do you want to close this window?

Source: Internet
Author: User

Normally, when we call Window.close to close a window opened from the Address bar, ie pops up and says, "the page you're viewing is trying to close the window, do you want to close the window?"

You can replace the window.close with the script below and then test it again:

// Close    $ ("#close_btn"). Click (function() {        newwin = window.open ("", "_parent", "");          Newwin.close ();      });

Is there a hint? The reason for guessing is that when the window is not opened by a script, calling the Close method ie prompts the user to close the window, and when the window is opened by a script, calling the Close method closes the window directly.

Let Window.close not prompt: The webpage you are viewing is trying to close the window. Do you want to close this window?

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.