function init() { var yanzhengma = window.prompt("输入访问口令", ""); if( yanzhengma == "123" ) { location.href = "/index.html"; return true; } else { alert("密码错误,重新输入"); } } 标签: HTML