Links

Lists

Latest Updates

Ruby On Rails List
Python list
Advanced Java
The JavaScript List
Apache Users
Full Disclosure
Linux Security

Search the archives!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Javascript] live counter help!!!


  • From: eligio at gmail.com (Eligio Morgado)
  • Subject: [Javascript] live counter help!!!
  • Date: Sun May 8 11:00:20 2005

Try something like:


// This in <head>

<script language="javascript">
  var nTotal = 0;

  function fncUpdate()
  {
    document.getElementById("lblTotal").innerHTML = ++nTotal;

    setTimeout("fncUpdate()", 1000);
  }
</script>

-----------------------------------------------------------
// add this in <body>

<body onLoad="javascript:fncUpdate();">

<div id="lblTotal">&nbsp;</div>




Good luck!


On 5/8/05, S.F. Alim <salim@xxxxxxxxxxx> wrote:
>  
>  
> 
> Hi list, 
> 
>   
> 
> Im just a beginner in programming world and javascript is like a black hole
> for me, so I will simple ask and wait for list to answer? 
> 
>   
> 
> How do you increase to a counter without refreshing the whole page. For
> example if you check site www.gmail.com under "Don't throw anything away."
> Heading there is counter which is increasing, 
> 
>  And other example is www.neopets.com where time (seconds) is changing
> without refreshing the whole page. 
> 
>   


> 
> Any link or hint or code will be welcome ( even comments ) ;) 
> 
> Thanks in advance. 
> 
> salim 
> _______________________________________________
> Javascript mailing list
> Javascript@xxxxxxxxxx
> https://lists.LaTech.edu/mailman/listinfo/javascript
> 
> 
> 


-- 
Este correo electr?nico puede contener informaci?n confidencial y/o
privilegiada, pero tambi?n puede ser que contenga una parida. Si usted
no es el destinatario arriba mencionado del mensaje (o ha recibido
este correo electr?nico por error) por favor notif?quelo
inmediatamente al remitente y destruya este e-mail as? como todo el
contenido de su disco duro. Cualquier copia no autorizada, divulgaci?n
o distribuci?n del material incluido en este correo electr?nico queda
estrictamente prohibida, o no.

This e-mail may contain guachu guachu guachu