Ver Mensaje Individual
  #28 (permalink)  
Antiguo 29/07/2002, 03:23
Avatar de epa2
epa2
 
Fecha de Ingreso: abril-2002
Ubicación: Málaga
Mensajes: 1.475
Antigüedad: 22 años, 1 mes
Puntos: 9
Re: ¿como doy los buenos dias a los visitantes?

Bueno, tengo problemas con la variable "imagen1"

Verás, despues de introducir mi nombre me sale el siguiente error, "imagen1" no está definido.

Echale un vistazo al código, ahí te lo mando.
Miralo cuando puedas y me dices....

Salu2
ByE

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>buenos dias </title>
</head>
<body bgproperties="fixed" vlink="#0000FF" background="images/FONDO.jpg">
<script language="Javascript">
<!--
/*-- for(unknown){ [email protected] } --
Do N't Move Here is unKnown Production's --*/
var today = new Date();
var hora=today.getHours();
var expiry = new Date(today.getTime() + 91 * 24 * 60 * 60 * 1000); // 91 dias
function setCookie(name, value)
{
document.cookie=name + "=" + escape(value) + "; expires=" + expiry.toGMTString();
}

function lee(valor)
{
document.cookie.search(RegExp("("+valor+ "=)([^;]*)(;*)","gi"))
return unescape(RegExp.$2)
}
if(lee('usass'))
var usuario = lee('usass')
else{
var u=prompt("Escribe tu nombre, por favor.","")
if(u){setCookie('usass',u);usuario=u}
else{usuario = "Estimado usuario"}
}
if (hora<6)
{
mens=(usuario+" Hoy has madrugado mucho...¿O no te has acostado?");
imagen1.src="IMAGES/m10.gif"
}
else if (hora<12)
{
mens=(usuario+" Buenos dias");
imagen1.src="IMAGES/m12.gif"
}
else if (hora<=18)
{
mens=("Buenas Tardes "+usuario);
imagen1.src="IMAGES/m9.jpg"
}
else
{
mens=("Buenas Noches "+usuario);
imagen1.src="IMAGES/salir.gif"
}
</script>
</body>
</html>