Hello,
I have a Javascript that calculates and displays how long, in minutes
and seconds a user has been in online(Google Gears development) mode on a given web
page. I need however, to modify the script so that it calculates and
displays how long the user has been online on the web site.
For e.g. on page 1 for 2 minutes 12 seconds.
Moves to page 2 - total time on page 1 and 2= 4 minutes 13 seconds.
My script (see below) starts a second counter then converts that to minutes and seconds.
I have tried passing the secVar0 variable in the url but that comes back "undefined".
Does anyone have any pointers please?
Thanks,
meerkat
p.s. I can't use server-side solution!
I have a Javascript that calculates and displays how long, in minutes
and seconds a user has been in online(Google Gears development) mode on a given web
page. I need however, to modify the script so that it calculates and
displays how long the user has been online on the web site.
For e.g. on page 1 for 2 minutes 12 seconds.
Moves to page 2 - total time on page 1 and 2= 4 minutes 13 seconds.
My script (see below) starts a second counter then converts that to minutes and seconds.
I have tried passing the secVar0 variable in the url but that comes back "undefined".
Does anyone have any pointers please?
Thanks,
meerkat
p.s. I can't use server-side solution!
Code:
if(request.responseText != "" && request.responseText.indexOf("404 Page not found") == -1)
{
c=0;
var startTicker = startCount1();
secVar0 = startTicker;
minVar = Math.floor(secVar0/60);
secVar = secVar0 % 60;
document.getElementById('Text1').innerHTML = "Time Online: " +" Minutes: " +minVar+" Seconds: "+ secVar;
document.getElementById('serverstatus').innerHTML = '<img src="online.gif">';
}