Saving time spent on page to web server's log file
1 2 (function(){ 3 var start = new Date; 4 window.onunload = function(){ 5 var time = (new Date - start ); 6 var image = new Image; 7 image.src = "/dummy?t=" + time + "&url=" + document.location; 8 } 9 })();