1. Insert the following code between
<Script>
Function rusure ()
{
Question = confirm ("Are you sure you want to enter? ")
If (question! = "0 ")
{
Window. open ("", "test announcement window", "width = 340, height = 163, toolbar = 0, status = 0, menubar = 0, resize = 0 ");
}
}
</Script>
2. Add the onclick () statement to the link label:
<A href = "" onClick = "rusure (); return false;"> Click me </a>
The implementation method is two steps. First, insert the JavaScript code in the source code paste box to the
This method can also be used in other places. For example, if a "submit" button is added with a confirmation dialog box, it will give the submitter a chance to repent. There are several standard dialogs provided by JavaScript. We will list them in the following table for your reference.
Name and usage |
Usage explanation |
Return value |
Confirmation dialog box: Re = confirm ("confirm information ") |
Select "OK" or "cancel" and use the return value to control the response. |
True or false (True/False) |
Warning dialog box: Alert ("warning ") |
Only one warning. Click "OK" to automatically disappear. |
No return value |
Input dialog box: Re = prompt ("Question", "default answer ")
|
Return the information entered by the user and perform the next step. |
Text string or null value entered by the user |
</