最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
输入正确进入密码保护页
时间:2022-06-30 09:18:17 编辑:袖梨 来源:一聚教程网
把如下代码加入区域中:
T LANGUAGE="JavaScript">
function password() {
var testV = 1;
var pass1 = prompt('请输入密码(密码是welcome):','');
while (testV < 3) {
if (!pass1)
history.go(-1);
if (pass1 == "welcome") {
alert('密码正确!');
break;
}
testV+=1;
var pass1 =
prompt('密码错误!请重新输入:');
}
if (pass1!="password" & testV ==3) history.go(-1);
return " ";
} document.write(password());
function password() {
var testV = 1;
var pass1 = prompt('请输入密码(密码是welcome):','');
while (testV < 3) {
if (!pass1)
history.go(-1);
if (pass1 == "welcome") {
alert('密码正确!');
break;
}
testV+=1;
var pass1 =
prompt('密码错误!请重新输入:');
}
if (pass1!="password" & testV ==3) history.go(-1);
return " ";
} document.write(password());
相关文章
- c语言scanf的正确使用及技巧 09-09
- c语言sort函数编写怎么做 09-09
- 《CSOL》怎么看-事实变化和判断依据 09-09
- c语言staticint与int的区别 09-09
- 上古修仙什么职业好玩 最新职业推荐有哪些-类型差异和选择建议 09-09
- 01背包问题c语言代码穷举怎么写 09-09