dandan
Regular Member
- Jan 7, 2009
- 269
- 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>