2021-03-12-HTML跳转加密
layout: “post”
cid: 18
title: “HTML跳转加密”
slug: “18”
date: 2021/03/12 23:59:00
updated: 2021/03/12 23:59:53
status: “publish”
author: “789cn”
categories:
- 🚀Linux
tags: - 信息互联
- linux
excerpt:imgst:
代码一HTML顶部或headn之间:
<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>
<!--下面添加你要显示的内容或者代码-->
显示内容!
代码二加在HTML顶部或headn之间:
<script type="text/javascript">
loopy()
function loopy() {
var sWord =""
while (sWord != "123") {//设置密码
sWord = prompt("输入正确密码才能登陆!")
}
alert("欢迎访问")
}
</script>
<!--下面添加你要显示的内容或者代码-->
内容!
代码三加在HTML顶或headn之间(输入密码以后自动跳转指定网站):
<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://xxinn.cn";//添加你要跳转的页面
break;
}
testV+=1;
var pass1 =
prompt('密码错误','');
}
if (pass1!="password" & testV ==3)
history.go(-1);
return " ";
}
document.write(password());
</script>
License:
CC BY 4.0