When JS is used to call the window. Close () method to close a window, how does one disable the pop-up dialog window?

Source: Internet
Author: User
Question: Q: How can I disable the pop-up dialog window by calling window. Close () in JS?

  • Original Discussion link:Http://community.csdn.net/expert/topicview1.asp? Id = 3670997
  • Forum:JavascriptAudit Team:Web Development
  • Questioner:Hwh215Released:Meizz
  • Thanks:Meizz, meizz, qjrein
  • Keywords:Javascript web development
  • Answer:

    Big brother:
    On the webpage, I use js to call window. Close () to close the current window. However, a dialog box is displayed in the browser asking if I want to close the window. How can I avoid this dialog box and close the current window directly?
    ---------------------------------------------------------------

    Add one more sentenceCode:

    Window. Opener = "meizz"; // ie5.5 +
    Window. Close ();
    ---------------------------------------------------------------

    <! -- Ie5.5 or above -->
    <Object ID = webbrowser classid = CLSID: 8856f961-340a-11d0-a96b-00c04fd705a2 Height = 0 width = 0> </Object>
    <Input type = button value = print onclick = "document. All. webbrowser. execwb (6, 1)">
    <Input type = button value = print onclick = "document. All. webbrowser. execwb (6, 6)">
    <Input type = button value = page setting onclick = "document. All. webbrowser. execwb (8, 1)">
    <Input type = button value = print preview onclick = "document. All. webbrowser. execwb (7,1)">

    <Input type = button value = Enable onclick = "document. All. webbrowser. execwb (1, 1)">
    <Input type = button value = save as onclick = "document. All. webbrowser. execwb (4,1)">
    <Input type = button value = attribute onclick = "document. All. webbrowser. execwb (10, 1)">
    <Input type = button value = select all onclick = "document. All. webbrowser. execwb (17,1)">
    <Input type = button value = Refresh onclick = "document. All. webbrowser. execwb (22,1)">
    <Input type = button value = Close Window onclick = "document. All. webbrowser. execwb (45, 1)">
    ---------------------------------------------------------------

    Window. openner = NULL;
    Window. Close ();

  •  

    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.