Descriptions of dialog boxes and status bars in JavaScript

Source: Internet
Author: User

  • Three kinds of dialog box diagram:

    The following three images are alert (), confirm () and prompt ().

    Alert () dialog box prompts

    Confirm () dialog box prompts

    Prompt () dialog box prompts

  • Three kinds of dialog box introduction:

    The alert () method pop-up dialog box just displays the message and alerts the user.

    The Confirm () method is used to ask the user for confirmation and to display two buttons-confirmation and cancellation. Equivalent to the IF/ELSE structure, if you click on the Confirmation button, proceed to the following program, if you click the Cancel button, return False.

    The prompt () method comes with an input box that returns the content that the user entered in the input box. The goal is to get user input.

  • dialog box blocking process introduction:

    Both confirm () and prompt () will be blocked, that is, they will not return until the user turns off the dialog boxes they display. It also means that the code stops running when a dialog box pops up. If the document is currently being loaded, the mount will also stop until the user responds with the required input. There is no way to prevent these methods from blocking because their return value is the input of the user, so they must wait for the user to enter before returning.

    In most browsers, alert () also causes blocking and waits for the user to close the dialog box. However, the alert () method does not cause blocking in some browsers (especially Netscape3 and 4 on UNIX platforms). However, Keoko on the FEDORA11 test, it will be blocked, of course, I did not use Netscape test, I use the Firefox browser test, the same block

  • Related Article

    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: 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.