خرید بک لینک

Vote count: 0

I'm using a system to track user activity. It works like a charm on Google Chrome but it doesn't work on Firefox and Safari (i guess caused by window.close) because doesn't write 'end_start' in my db and the page results still opened :

jsHandler.js

function start(pageName) {
    var xmlhttp3;
    if (window.XMLHttpRequest) {
        xmlhttp3 = new XMLHttpRequest();
        } else {
        xmlhttp3 = new ActiveXObject("Microsoft.XMLHTTP");
}
      xmlhttp3.onreadystatechange=function() {
        if (xmlhttp3.readyState==4 && xmlhttp3.status==200) {
        }
      }
      xmlhttp3.open("GET","includes/trackStart.php?pageName="+pageName,true);
      xmlhttp3.send();
    }


    function end() {
        var xmlhttp3;
        if (window.XMLHttpRequest) {
        xmlhttp3 = new XMLHttpRequest();
        } else {
        xmlhttp3 = new ActiveXObject("Microsoft.XMLHTTP");
    }
      xmlhttp3.onreadystatechange=function() {
        if (xmlhttp3.readyState==4 && xmlhttp3.status==200) {

        }

      }
        xmlhttp3.open("GET","includes/trackEnd.php",true);
        xmlhttp3.send();

    }

HTML

<script src="../includes/jsHandler.js"></script>
<script>
window.onload = function(){ retu start('<?php echo basename($_SERVER['REQUEST_URI'], '?' . $_SERVER['PATH_INFO']); ?>');};
window.onbeforeunload = function(){ retu end(); };
window.onclose = function(){ retu end(); };
</script>

Thank you!

asked 24 secs ago

برچسب: نویسنده: استخدام کار تاريخ: سه شنبه 15 تير 1395 ساعت: 18:19

صفحه بندی