wuluogan

方法一

<script type="text/javascript">   
function password() {   
var testV = 1;   
var pass1 = prompt(\'请输入密码\',\'\');   
while (testV < 3) {   
if (!pass1)   
history.go(-1);   
if (pass1 == "123") {//初始密码123   
alert(\'密码正确\');   
break;   
}   
testV+=1;   
var pass1 =   
prompt(\'密码错误!请重新输入:\');   
}   
if (pass1!="password" & testV ==3)   
history.go(-1);   
return " ";   
}   
document.write(password());   
</script>  
<!--下面添加你要显示的内容或者代码-->

方法二

<script type="text/javascript">   
loopy()   
function loopy() {   
var sWord =""  
while (sWord != "123") {//设置密码
sWord = prompt("输入正确密码才能登陆!")   
}   
alert("欢迎访问")   
}   
</script> 
<!--下面添加你要显示的内容或者代码-->

方法三

<script type="text/javascript">   
function password() {   
var testV = 1;   
var pass1 = prompt(\'请输入密码:\',\'\');   
while (testV < 3) {   
if (!pass1)    
history.go(-1);   
if (pass1 == "123") {//设置密码
alert(\'口令正确,进行跳转\');   
window.location.href="http://test.junyao2018.cn/";//添加你要跳转的页面
break;   
}    
testV+=1;   
var pass1 =    
prompt(\'密码错误\',\'\');   
}   
if (pass1!="password" & testV ==3)    
history.go(-1);   
return " ";   
}    
document.write(password());   
</script>
 

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2022-02-15
  • 2022-12-23
  • 2022-03-02
  • 2022-01-15
  • 2021-11-07
  • 2021-10-07
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-27
  • 2021-05-16
  • 2021-10-12
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案