0
javascript var stop?
Is there a way if you don't answer "1234" is there a way that the page won't load. var b = ("*****"); var password = prompt(" Enter password please!" , b); if (password==12345) { confirm("Access granted, Welcome") } else { alert("Get out of here") }
5 Respostas
+ 1
its better to loop until the password is correct, and then redirect to another site if there are too much tries.
to change location:
window.location.replace("http://google.com");
if not, you can use DOM and empty all the page.
+ 1
while pass!= 1234 && tries<4
//code and tries++
else
redirect
0
how could i loop it?
0
It's not working
0
its not the literal code. You also have to create and assign var tries