Ver Mensaje Individual
  #1 (permalink)  
Antiguo 06/05/2002, 01:42
elunicoNEO
 
Fecha de Ingreso: mayo-2001
Mensajes: 57
Antigüedad: 23 años
Puntos: 1
ayuda con este script

Hola, no soy muy dado a javascript y por lo tanto no se donde poner el pasword del sigueinte codigo,

//Script begins

function AccessGranted()
{
document.write('<bgsound src="AccessGranted.wav" loop=1>')
// You can replace AccessGranted.wav audio file with your own

document.write('<center><h1>Access Granted!</h1></center>')

if (confirm("Enter protected area?"))
{
window.location="http://happysmart.net/JavaScript/MasterList/Category.htm"
// Replace this URL with your own
}
else document.location="javascript: history.go(-1)"

}

function IntruderAlert()
{
document.write('<bgsound src="IntruderAlert.wav" loop=-1>')
document.write('<center><h1>Intruder Alert!</h1></center>')

alert("Intruder Alert!")
document.location="javascript: history.go(-1)"
}

function checkPassword()
{
var turn
var yourPassword = "HappySmart" // Replace "HappySmart" with your own password

for(turn=0;turn<3;++turn)
{
switch(turn)
{
case 0:
password=prompt('Enter password:',"");
if (password == yourPassword) AccessGranted()
else alert("Password incorrect. This was your first attempt.")
break

case 1:
password=prompt('Enter password:',"");
if (password == yourPassword) AccessGranted()
else alert("Password incorrect. This was your second attempt.")
break

case 2:
password=prompt('Enter password:',"");
if (password == yourPassword) AccessGranted()
else alert("Password incorrect. This was your last attempt.")
IntruderAlert()
}
if (password == yourPassword) break;
}
}

document.write('<form><input type=button value="Login" onClick="checkPassword()">')
//Script ends

porfavor diganme donde pongo la clave. De antemano gracias.