Ile sekund?


Fajny kod pokazujący ile sekund jesteś już na podstronie.

<html>
<head>
<meta http-equiv="Content-Language" content="pl">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1250">
<title>WEBZONE.chost.pl</title>
</head>
<body>
<script>
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("."));
document.tijd.hiero.value=mySecs1
window.setTimeout('getSecs()',1000);
if (mySecs1==60) {alert("jesteś tutaj już 60 sekund ...") }
if (mySecs1==333) {alert("jesteś tutaj już 333 sekundy...") }
if (mySecs1==666) {alert("jesteś tutaj już 666 sekund ...") }
if (mySecs1==999) {alert("Ciągle jesteś zainteresowany tą stroną; to już 999 sekund...") }
}
</script>
<body onLoad="window.setTimeout('getSecs()',1)">
<form name="tijd"><P>
<center>Jesteś tutaj już przez:
<br>
<input size=4 name=hiero>
<br>sekund.
</form>
</body>
</html>

Sprawdź demo


sekunda licznik




Komentarze zostały wyłączone.