home *** CD-ROM | disk | FTP | other *** search
- <ccResource>
- <ccTitle>
- Time Spent
- </ccTitle>
- <ccCategory>
- Clocks
- </ccCategory>
- <ccDescription>
- This scripts tell your sites visitor how long they spent at the page.
- </ccDescription>
- <ccInstructions>
-
- </ccInstructions>
- <ccHeadContent>
- <SCRIPT LANGUAGE="JavaScript">
- <!-- Begin
- 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.forms[0].timespent.value = sMins+":"+sSecs;
- window.setTimeout('getSecs()',1000);
- }
- // End -->
- </script>
- </ccHeadContent>
- <ccBodyContent>
-
- <CENTER>
- <FORM>
- <FONT SIZE="2" FACE="Arial">Time spent here: </FONT><input size=5 name=timespent>
- </FORM>
- </CENTER>
- </ccBodyContent>
- <ccElementContent>
-
- <ccElementName>onLoad</ccElementName>
- <ccElementAction>window.setTimeout('getSecs()',1)</ccElementAction>
-
- </ccElementContent>
- <ccExtraData>
-
- </ccExtraData>
- </ccResource>