Copy codeThe Code is as follows:
<Script language = "JAVASCRIPT">
<! --
Var ap_name = navigator. appName;
Var ap_vinfo = navigator. appVersion;
Var ap_ver = parseFloat (ap_vinfo.substring (0, ap_vinfo.indexOf ('(')));
Var time_start = new Date ();
Var clock_start = time_start.getTime ();
Var dl_ OK = false;
Function init ()
{
If (ap_name = "Netscape" & ap_ver >=3.0)
Dl_ OK = true;
Return true;
}
Function get_time_spent ()
{
Var time_now = new Date ();
Return (time_notesgettime ()-clock_start)/1000 );
}
Function show_secs () // show the time user spent on the side
{
Var I _total_secs = Math. round (get_time_spent ());
Var I _secs_spent = I _total_secs % 60;
Var I _mins_spent = Math. round (I _total_secs-30)/60 );
Var s_secs_spent = "" + (I _secs_spent> 9 )? I _secs_spent: "0" + I _secs_spent );
Var s_mins_spent = "" + (I _mins_spent> 9 )? I _mins_spent: "0" + I _mins_spent );
Document. fm0.time _ spent. value = s_mins_spent + ":" + s_secs_spent;
Window. setTimeout ('show _ secs () ', 1000 );
}
// -->
</SCRIPT>