Whats this script do?

dandan

Regular Member
Joined
Jan 7, 2009
Messages
269
Reaction score
65
Anyone have any ideas what this script does? Just doing some snooping on a competitors page and can't figure out what this does.

Code:
<script>
/*
 * window.onerror handler
 */
/*window.onerror = function(message, url, line) {
    if (window.XMLHttpRequest) {
        var xhr = new XMLHttpRequest();

        // the url to post data to
        var logurl = "error.php";

        // serialize the POST params
        var logurl = logurl+'?message=' + message + '&url=' + url + '&line=' + line + '&userAgent='        + window.navigator.userAgent;

    var params = '';

        // open an asynchronous connection
        xhr.open("GET", logurl, true);

        // set the appropriate headers
        xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
        xhr.setRequestHeader("Content-Length", params.length);
        xhr.setRequestHeader("Connection", "close");

        // send the request
        xhr.send(params);
    }

    // returning false triggers the execution of the built-in error handler
    return false;
}
window.mytime = new Date();
function sendTime()
{
    var p = document.createElement('iframe');
    var curTime = new Date();
    var spentTime = Math.round((curTime - window.mytime)/1000);
    var framesLength = document.getElementsByTagName("iframe").length;
    p.setAttribute('src', '/img4.jpg?'+spentTime+'_'+framesLength);
    p.setAttribute('width', 0);
    p.setAttribute('height', 0);
    p.setAttribute('frameborder', '0');
    document.body.appendChild(p);
}
setInterval(sendTime,5000);*/
</script>
 
Technically nothing, it's commented out. Otherwise it will send a message to their server if the page errors out. There's also the function at the bottom that creates an no-sized iframe with the time spent on the page and updates it every 5 seconds so they can tell when you left it.
 
aah cheers mate.. thought they where upto something but couldnt figure it out.
 
its looks like a tracker..
its load 0x0 image that track activity...
its called Pixel
 
Back
Top