i hv a timer function code ...which displays the time taken by the user on visiting this page....
the time-taken status is displayed in the status bar of IE but not Netscape.
is there anyother way where i can display in the status bar...
kindly help
var here = new Date();
function timer()
{
var now = new Date();
var m = Math.floor((Math.ceil((now.getTime() - here.getTime())/1000)/60));
if (m<1) m = 0 + " minutes";
else if (m==1) m = m + " minute";
else m = m + " minutes";
var s = Math.ceil((now.getTime() - here.getTime())/1000);
if (s == 0) s = s + " seconds.";
if (s == 1) s = s + " second.";
if (s > 1 && s < 60) s = s + " seconds.";
if (s == 60) s = 0 + " seconds.";
if (s > 60) s = s - (60*parseInt(m)) + " seconds.";
var r = "You've been here " + m + " and " + s ;
defaultStatus = r;
setTimeout('timer()', 1000);
}
</script>
</head>
<body onload="timer();" onunload="self.Status='';">
</body>
</html>
the time-taken status is displayed in the status bar of IE but not Netscape.
is there anyother way where i can display in the status bar...
kindly help
var here = new Date();
function timer()
{
var now = new Date();
var m = Math.floor((Math.ceil((now.getTime() - here.getTime())/1000)/60));
if (m<1) m = 0 + " minutes";
else if (m==1) m = m + " minute";
else m = m + " minutes";
var s = Math.ceil((now.getTime() - here.getTime())/1000);
if (s == 0) s = s + " seconds.";
if (s == 1) s = s + " second.";
if (s > 1 && s < 60) s = s + " seconds.";
if (s == 60) s = 0 + " seconds.";
if (s > 60) s = s - (60*parseInt(m)) + " seconds.";
var r = "You've been here " + m + " and " + s ;
defaultStatus = r;
setTimeout('timer()', 1000);
}
</script>
</head>
<body onload="timer();" onunload="self.Status='';">
</body>
</html>