Ver Mensaje Individual
  #5 (permalink)  
Antiguo 03/12/2002, 12:48
Avatar de sordo77
sordo77
 
Fecha de Ingreso: noviembre-2002
Ubicación: Rosario
Mensajes: 70
Antigüedad: 21 años, 5 meses
Puntos: 0
Mira, lo saque de aca

4 steps if you require the clock - 1 step if you don't
================================================== ================
Step 1 - put this in your <head> tag

<META HTTP-EQUIV="REFRESH" CONTENT="10;URL=refresh2.html">

================================================== ==========
part 2 - the clock
================================================== =============
<SCRIPT LANGUAGE="JavaScript">



<!-- Begin
startday = new Date();
clockStart = startday.getTime();
function initStopwatch() {
var myTime = new Date();
var timeNow = myTime.getTime();
var timeDiff = timeNow - clockStart;
this.diffSecs = timeDiff/1000;
return(this.diffSecs);
}
function getSecs() {
var mySecs = initStopwatch();
var mySecs1 = ""+mySecs;
mySecs1= mySecs1.substring(0,mySecs1.indexOf(".")) + " secs.";
document.form1.timespent.value = mySecs1
window.setTimeout('getSecs()',1000);
}
// End -->
</SCRIPT>

================================================== ===========
part 3
================================================== =======

<BODY onLoad="window.setTimeout('getSecs()',1)">

================================================== ===========
part 4
================================================== ===========

<!-- A1 --><CENTER>
<FORM NAME="form1">
<input type="text" value="" name="timespent" size=10>
</FORM>
</CENTER><!-- -->

<!-- Script Size: 1.36 KB -->


Cita:
Mensaje Original por delfiero


Creo que también funciona, pero tarda 10 segundos en hacer el refresh, no?