How to update timer in seconds and display on web page with out reset
[nobr]Hello friends
I have 3 JSP Pages namedlogin.jsp ,first.jsp andsecond.jsp
I got a problem in second .jsp
i am using the code forfirst.jsp as :
<html>
<%@ page import="java.util.*"%>
<title>Just like home page</title>
<IMG src="D:\adp_docs\cooltext53799474.gif">
<head>
<script language="JavaScript">
var dd =new Date();
function UpdateClock()
{
var tDate =new Date();
var l1 = dd.getTime();
var l2 = tDate.getTime();
var diff = l2 - l1 ;
var h_diff = Math.floor(diff/1000/60/60);
diff = diff - h_diff*1000*60*60;
var m_diff = Math.floor(diff/1000/60);
diff = diff - m_diff*1000*60;
var s_diff = Math.floor(diff/1000);
document.frm2.theTime.value =""
+ h_diff +":"
+ m_diff +":"
+ s_diff;
setTimeout("UpdateClock()", 1000);
}
function StartClock()
{
setTimeout("UpdateClock('')", 500);
}
</script>
</head>
<body onload="StartClock()">
<br><br><br>
<form name="frm2" action="second.jsp">
<input type="text" name="theTime" size=30><br><br>
<br>
<center>
<input type="submit" name="sub" value=" SignOut ">
</center>
</form>
</body>
When the user entered in first.jsp using login page , the timer will start and displays total time of access in a text box with updation,the user will go to the second.jsp through this page . This is working fine but when the user coming from the second.jsp to first.jsp the timer is resets and it displays the total accessed time from 0:0:1(starting time).
I don't want to reset the time again when the user coming back to first.jsp
PLZ help me
Thanks in advance..
Sumaduram.[/nobr]

