Ver Mensaje Individual
  #9 (permalink)  
Antiguo 18/09/2008, 18:18
amborg
 
Fecha de Ingreso: septiembre-2008
Mensajes: 2
Antigüedad: 16 años, 4 meses
Puntos: 0
Respuesta: conteo regresivo y enviar datos

Cita:
<script>

var timeLimit = 15; //tiempo en minutos
var conteo = new Date(timeLimit * 30000);

function inicializar(){
document.getElementById('cuenta').childNodes[0].nodeValue =conteo.getMinutes() + ":" + conteo.getSeconds();
}

function cuenta(){
intervaloRegresivo = setInterval("regresiva()", 1000);
}

function regresiva(){
if(conteo.getTime() > 0){
conteo.setTime(conteo.getTime() - 1000);
}else{
clearInterval(intervaloRegresivo);
alert("Fin");
}

document.getElementById('cuenta').childNodes[0].nodeValue =
conteo.getMinutes() + ":" + conteo.getSeconds();
}
var onload;
onload = inicializar();
</script>
falto declarar onload y agregarle los () a la funcion inicializar