|
↑
Page Details >>>
Occasionally, it might be interesting to show the visitor how long they have been on your page. So, you can use this script to write a clock to the screen that will tell them exactly that!
Add the below code to the <body> section of your page:
<script
language="javascript"
type="text/javascript">
startday
=
new
Date();
clockStart
=
startday.getTime();
function
initStopwatch()
{
var
myTime =
new
Date();
return((myTime.getTime()
-
clockStart)/1000);
}
function
getSecs()
{
var
tSecs =
Math.round(initStopwatch());
var
iSecs =
tSecs %
60;
var
iMins =
Math.round((tSecs-30)/60);
var
sSecs =""
+
((iSecs
>
9)
?
iSecs :
"0"
+
iSecs);
var
sMins =""
+
((iMins
>
9)
?
iMins :
"0"
+
iMins);
document.Time.timespent.value
=
sMins+":"+sSecs;
window.setTimeout('getSecs()',1000);
}
function
Go()
{
window.setTimeout('getSecs()',1)
}
window.onload
=
Go;
</script>
<FORM
name="Time">
<input
size=5
name=timespent>
</FORM>
|
↓
http://www.cashadvance-loans.net/mississippi/cash-advance-hattiesburg-ms/
|