复制代码代码如下:
<ภาษาสคริปต์ = "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 = วันที่ใหม่ ();
var clock_start = time_start.getTime ();
var dl_ok = false;
ฟังก์ชั่น init ()
-
if (ap_name == "netscape" && ap_ver> = 3.0)
dl_ok = true;
กลับมาจริง;
-
ฟังก์ชั่น get_time_spent ()
-
var time_now = วันที่ใหม่ ();
return ((time_now.getTime () - clock_start)/1000);
-
function show_secs () // แสดงเวลาที่ผู้ใช้ใช้ไปด้านข้าง
-
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 ()', 1,000);
-
-
</script>