欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

js統(tǒng)計(jì)網(wǎng)頁在線時(shí)間的腳本

 更新時(shí)間:2008年04月24日 19:35:57   作者:  
分析用戶行為時(shí),某網(wǎng)頁停留時(shí)間可能會(huì)是個(gè)可參考的數(shù)據(jù) 由后臺(tái)分析函數(shù)取一個(gè)合理值作為在線時(shí)間
每xxxxx毫秒檢測(cè)一次是否在線,
TR_COUNT次之后設(shè)定改用戶為假死狀態(tài)(即不在當(dāng)前頁面活動(dòng),afk..)
當(dāng)頁面關(guān)閉時(shí)把停留時(shí)間送出,

/**//* ----------------------------------------------------------------------------
* Script Name: online.js
* Last Modified: 2008-4-13 22:25
* Author: meyu
* Copyright (c) 2008
* Purpose: 跟蹤在線時(shí)間
* ----------------------------------------------------------------------------*/

function TR_XMLHttpObject(url)...{
    this.XMLHttp=null;
    this.url=url;
    this.init=function()...{
        if(window.XMLHttpRequest)...{
            this.XMLHttp=new XMLHttpRequest();
        }else if(window.ActiveXObject)...{
            this.XMLHttp=new ActiveXObject("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))...{
    var TR_COUNT=0;
    var TR_x=new TR_XMLHttpObject(window.location.href.replace(/&?(?:flush_count=)(d+)/i,
        function(a,d)...{
            TR_COUNT=parseInt(d);
            return "";
            })
    );
    function send()...{
        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);};
}

相關(guān)文章

最新評(píng)論