js统计网页在线时间的脚本

日落沧海看夕阳,万丈霞光谱辉煌。轻叹美景难留住,只因月色要锋芒!你在桥上看风景,看风景的人在桥下看你。你只知道自己吃了韭菜盒子,却不知道别人在盒子里还加了鸡蛋。
每xxxxx毫秒检测一次是否在线,
TR_COUNT次之后设定改用户为假死状态(即不在当前页面活动,afk..)
当页面关闭时把停留时间送出, /**//*----------------------------------------------------------------------------
*ScriptName:online.js
*LastModified:2008-4-1322:25
*Author:meyu
*Copyright(c)2008
*Purpose:跟踪在线时间
*----------------------------------------------------------------------------*/ functionTR_XMLHttpObject(url)...{
this.XMLHttp=null;
this.url=url;
this.init=function()...{
if(window.XMLHttpRequest)...{
this.XMLHttp=newXMLHttpRequest();
}elseif(window.ActiveXObject)...{
this.XMLHttp=newActiveXObject("Microsoft.XMLHTTP");
}
};
this.init();
this.sendData=function(param)...{
with(this.XMLHttp)...{
open('GET',this.url+(param||''),true);
send(null);
}
};
}
if(/flag=flush/i.test(window.location.search))...{
varTR_COUNT=0;
varTR_x=newTR_XMLHttpObject(window.location.href.replace(/&?(?:flush_count=)(d+)/i,
function(a,d)...{
TR_COUNT=parseInt(d);
return"";
})
);
functionsend()...{
TR_COUNT++;
if(TR_COUNT<120)...{
TR_x.sendData('&flush_count='+TR_COUNT);
}
}
window.setInterval(send,30000);
window.onunload=function()...{TR_x.sendData('&flush_count='+TR_COUNT);};
}

以上就是js统计网页在线时间的脚本。每个月月底一个大休,周日适当休息,其余时间按计划进行,雷打不动,即使下冰雹,哪怕下刀子,去上自习!更多关于js统计网页在线时间的脚本请关注haodaima.com其它相关文章!

您可能有感兴趣的文章
JS获取鼠标点击时的位置

JS获取URL参数

Ajax跨域问题及解决方案(jsonp,cors)

ajax动态加载json数据并详细解析

ajax从JSP传递对象数组到后台的方法