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