我不明白为什么我的功能只适用于“Brackets”的“现场演示”,但不是当我尝试用我的index.html文件打开它时...为什么我的功能提示(Javascript)不起作用?
那是我的密码保护区功能:
function passWord() {
var testV = 1;
var pass1 = prompt('Please Enter Your Password',' ');
while (testV < 3) {
if (!pass1)
history.go(0);
if (pass1.toLowerCase() == "letmein") {
alert('You Got it Right!');
window.open('/html/ok.html',"_self");
break;
}
testV+=1;
var pass1 =
prompt('Access Denied - Password Incorrect, Please Try Again.','Password');
}
if (pass1.toLowerCase()!="password" & testV ==3)
history.go(0);
return " ";
}
请帮助我,感谢所有:d
你知道每个人都可以检查出你的JS代码来找到开发工具中的密码(和“ok”URL)吗?不要那样做,永远不要这样做。除此之外,“括号”是什么意思? – Lucero
@Lucero我的无辜让我觉得他只是在努力学习js,并且永远不会在生产中使用它:D – PierreDuc
@PierreDuc也许,但提高意识并不是错的。像这样的代码太多会在公共场合结束...... http://thedailywtf.com/series/code-sod – Lucero