Re: A Server call using onUnload
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.javascript archive

Re: A Server call using onUnload

From: Jasen Betts <jasen@free.net.nospam.nz>
Date: Fri Dec 23 2005 - 06:42:38 CET

On 2005-12-22, shlomi.schwartz@gmail.com <shlomi.schwartz@gmail.com> wrote:
> Hi all,

> I'm trying to create a server side log, that will show how much time a
> user was present on my web page.

If they save their page to their hard disk does that count as infinite time?

ISTM you are trying to measure the unmeasurable.

> I tried using onUnload and onBeforeUnload to do an http call to the
> server.
> I've noticed that the call pass to the server is not consistent.

if they close the tab or turn off their modem there is no unload.

if they minimise the window, switch to another tab, or leave the room
are they still "present"

> Q:Is there a better way of logging the time user spent on my page
> before leaving it?

convince them to install your logging software on their PC :)

> P.S: currently I'm using an Interval call each 5 sec that logs that the
> user is still there.

it'll tell you the page is still open, nothing more.

Bye.
   Jasen
Received on Fri Dec 23 20:31:47 2005