Enter a specific character to download. when you click download, a dialog box is displayed. enter the password and the password is correct to download the file. if the password is incorrect, the file cannot be downloaded. Below is a test of mine, but the effect is not met.
Script
Function _ add ()
{Var a = prompt ("enter the password for verification :","");
If (a = "mima "){
Alert ("Your input is correct! ");
}
Else
{
Alert ("Your input is incorrect! ");
}
}
Script
Download
The pop-up window is downloaded no matter whether the input is correct or not. If an error is returned after onclick, the pop-up window cannot be downloaded no matter whether the input is correct or not, or use another method to achieve the effect.
Reply to discussion (solution)
Script
Function _ add ()
{Var a = prompt ("enter the password for verification :","");
If (a = "mima "){
Alert ("Your input is correct! ");
}
Else
{
Alert ("Your input is incorrect! ");
Return false;
}
}
Script
Download
Upstairs. thank you.