Script Categories













Page Details >>> Top Seconds.

If the other time on page scripts seem too impersonal for you, this could be your solution. Instead of the 00:00 readout, it displays 'X Secs'.

Add the below code to the <body> section of your page:

<script language="javascript" type="text/javascript">      
/* Visit http://www.yaldex.com/ for full source code
and get more free JavaScript, CSS and DHTML scripts! */
<!-- 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.Time.timespent.value = mySecs1
window.setTimeout('getSecs()',1000);
}
function Go()
{
    window.setTimeout('getSecs()',1)
}
window.onload = Go;
// End -->
</script>
<FORM name="Time">
<input
size=9 name=timespent>
</FORM>

JavaScript Editor Get Advanced
JavaScript and Ajax Editor,
Validator and Debugger!

1st JavaScript Editor.



Code was highlighted by 1st JavaScript Editor (The Best JavaScript Editor!).




©