【发布时间】:2017-02-07 19:30:23
【问题描述】:
我已经使用密码保护了我的网站(我真的不需要“真正的”保护,它只是一个保存日期的小网站,没什么大不了的,只是不想让人们介意我的生意;) )
但我使用的代码似乎不适用于移动版本。每当我输入我选择的密码时,我总是收到密码错误的错误消息,即使它是正确的。知道如何解决这个问题吗?
var password = "please";
var x = prompt("Enter in the password "," ");
if (x.toLowerCase() == password) {
alert("Come right in \n \n You've entered in the right password");
window.location = "index.htm";
}
else {
window.location = "bad.htm";
}
【问题讨论】:
标签: javascript mobile passwords