如何对一个HTML页面设置密码输入?

来源:百度知道 编辑:UC知道 时间:2024/06/05 19:46:55
我有一个页面,不想给其他人看到,只想给我朋友看.
加个什么代码能让我朋友输入密码后就能看到页面.
换句话说,就是打开一个页面,先提示输入密码,密码对了就进入页面.
我不需要很复杂的,必须用VBSCript语句编写的.JS的我不会.

简单加密!意义不大!会玩网页的人就会看
<script language="JavaScript">
function password() {
var testV = 1;
var pass1 = prompt('请输入密码(密码是123):','');
while (testV < 3) {
if (!pass1)
history.go(-1);
if (pass1 == "123") {
alert('密码正确!');
break;
}
testV+=-1;
var pass1 =
prompt('密码错误!请重新输入:');
}
if (pass1!="password" & testV ==3)
history.go(-1);
return " ";
}
document.write(password());
</script>

我也不会