i am using Dotnet 2005 with framework 2.0 and backend as mysql 5.0
i want to update the time to database frequently with out disturbing the user and knowing to user so that once he closes the window and again logins answers he clicks has to be retrieved and time maintainence so please help in this case i have used following code to perform that in an another page
Expand|Select|Wrap|Line Numbers
- function start()
- {
- i++;
- timer = setTimeout("start()",1000);
- if(i==11)
- {
- // Updating the Radio Button value
- var sessionid = window.top.location.search.substring(0)
- var ind = sessionid.indexOf("&")
- if(ind==-1)
- ind=sessionid.length
- var mod = sessionid.substr(0,ind)
- var xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
- xmlhttp.onreadystatechange=function()
- {
- if (xmlhttp.readyState==4)
- {
- //alert(xmlhttp.responseText)
- }
- }
- var url = rev(window.top.location.toString());
- var ind = url.indexOf("/");
- url= url.substr(ind+1);
- url= rev(url)+"/time.aspx";
- var timeelapsed=hh+ ":"+mm+":"+ ss;
- var timeleft=hhLeft+":"+mmLeft+":"+ ssLeft;
- url =url+"?timeleft="+timeleft+"&timeelapsed="+timeelapsed ;
- xmlhttp.open("GET",url,true);
- xmlhttp.send(null);
- //document.forms("Form1").submit()
- // LoadTime()
- i=0;
- }
- ss = parseInt(ss) + 1;
- if(parseInt(ss)>59)
- {
- ss = "00";
- mm=parseInt(mm) + 1;
- }
- if(parseInt(mm)>59)
- {
- mm ="00";
- hh =parseInt(hh) + 1;
- }
- ssLeft = parseInt(ssLeft) - 1;
- if(parseInt(ssLeft)<0)
- {
- if(parseInt(mmLeft)>0)
- {
- ssLeft = 59;
- mmLeft=parseInt(mmLeft) -1
- }
- }
- if(parseInt(mmLeft)<=0 && parseInt(ssLeft)<=0)
- {
- if(parseInt(hhLeft)>0 )
- {
- mmLeft = 60;
- hhLeft=eval(hhLeft) - 1
- }
- }
- // Updating The Status
- curtm.innerText = hh + " : "+ mm + " : "+ss;
- remtm.innerText = hhLeft +" : "+ mmLeft + " : "+ssLeft;
- document.all("HH").value=hh
- document.all("MM").value=mm
- document.all("SS").value=ss
- document.all("HHLeft").value=hhLeft
- document.all("MMLeft").value=mmLeft
- document.all("SSLeft").value=ssLeft
- if((parseInt(hhLeft)<=0) && (parseInt(mmLeft)<=0) && (parseInt(ssLeft)<=0) || (parseInt(hh)<0) && (parseInt(mm)<0) && (parseInt(ssLeft)<0))
- {
- clearTimeout(timer)
- alert("finish");
- // document.forms("form1").action="main.aspx?key=close"
- // document.forms("form1").submit()
- // document.forms("Form1").action="Default.aspx?key=close"
- // document.forms("Form1").submit()
- }
- }
but it is not working the code in time.aspx does'nt excetues please any one help me .