Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Ajax running time watch

Have Programming Question? Ask it here!
 
 
 


Chakradhar Jha
running time watch
1 Answer(s)      3 years and 6 months ago
Posted in : Ajax


how to set running watch in applycation with ajax ?


Advertisement
View Answers

January 22, 2011 at 4:47 PM


Hi Friend,

Try the following code:

displaytime.jsp:

<html>
<head>
<script type="text/javascript">
function showData(){ 

xmlHttp=GetXmlHttpObject()
var url="displaytime.jsp";
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function stateChanged() { 
if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ 
    var today=new Date();
var h=today.getHours();
var m=today.getMinutes();
var s=today.getSeconds();
m=checkTime(m);
s=checkTime(s);
document.getElementById('time').innerHTML=h+":"+m+":"+s;
t=setTimeout('showData()',500);
}

function checkTime(i)
{
if (i<10)
  {
  i="0" + i;
  }
return i;
}
}


function GetXmlHttpObject(){
var xmlHttp=null;
try {
  xmlHttp=new XMLHttpRequest();
 }
catch (e) {
 try  {
  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e)  {
  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }
return xmlHttp;
}
</script>
</head>
<body onload="showData();">
<div id="time" ></div>
</body>
</html>

Thanks



Related Tutorials/Questions & Answers:
running time watch
running time watch   how to set running watch in applycation with ajax
how to set running watch with descending order in applycation with ajax
how to set running watch with descending order in applycation with ajax   like hh : mm : ss 23 : 59 : 59 23 : 58 : 10 22 : 20 : 01 21 : 45 : 59 . . . . . . 02 : 23 : 03 01 : 10 : 23 00 : 00 : 00
Advertisements
how to set running watch with descending order in applycation with ajax
how to set running watch with descending order in applycation with ajax   like hh : mm : ss 23 : 59 : 59 23 : 58 : 10 22 : 20 : 01 21 : 45 : 59 . . . . . . 02 : 23 : 03 01 : 10 : 23 00 : 00 : 00
Find the Running time in sql***
Find the Running time in sql***  I have 10 backend jobs in sql which runs at different time intervals. Sample data is shown below Table name:- Job... want to find the running time of both the jobs. (i.e when i run the query
identify the order of the average running time of the method
identify the order of the average running time of the method  public static double getMedian (double[] A) { // given an ordered array of length n, return the median int n = A.length; if ((n % 2) == 1) return A[n/2]; else
identify the order of growth of the average running time of the method.
identify the order of growth of the average running time of the method.   public static void manypeak (int n, double size) { if (n > 0) manypeak... drawpeak() takes constant time } if (n>0) manypeak(n/2, size/2
identify the order of growth of the average running time of the method.
identify the order of growth of the average running time of the method.   public static void manypeak (int n, double size) { if (n > 0) manypeak... drawpeak() takes constant time } if (n>0) manypeak(n/2, size/2
Digital watch using threads - Design concepts & design patterns
Digital watch using threads  import java.lang.Thread; import java.lang.*; import java.awt.*; class Time implements Runnable { int i,j,k,m...; Time() { f=new Frame(); p=new Panel(); l=new Label("seconds"); l1
time
time  how to find the current system time between the user login and logout using java
time
time  Hi. I have retrieved time from mysql database. its in th format hh:mm:ss. but i want to display only as hh:mm. wat to do? For this i already received the answer. But its converting the time in 24hr format to 12hr format
time
time  Hi. I have retrieved time from mysql database. its in th format hh:mm:ss. but i want to display only as hh:mm. wat to do? For this i already received the answer. But its converting the time in 24hr format to 12hr format
time
time  Hi. I have retrieved time from mysql database. its in th format hh:mm:ss. but i want to display only as hh:mm. wat to do? For this i already received the answer. But its converting the time in 24hr format to 12hr format
time
time  Hi. I have retrieved time from mysql database. its in th format hh:mm:ss. but i want to display only as hh:mm. wat to do? For this i already received the answer. But its converting the time in 24hr format to 12hr format
time
time  Hi. I have retrieved time from mysql database. its in th format hh:mm:ss. but i want to display only as hh:mm. wat to do? For this i already received the answer. But its converting the time in 24hr format to 12hr format
time
time  Hi. I have retrieved time from mysql database. its in th format hh:mm:ss. but i want to display only as hh:mm. wat to do? For this i already received the answer. But its converting the time in 24hr format to 12hr format
time
time  Hi. I have retrieved time from mysql database. its in th format hh:mm:ss. but i want to display only as hh:mm. wat to do? For this i already received the answer. But its converting the time in 24hr format to 12hr format
time
time  Hi. I have retrieved time from mysql database. its in th format hh:mm:ss. but i want to display only as hh:mm. wat to do? For this i already received the answer. But its converting the time in 24hr format to 12hr format
time
time  sir, i want to show system time on a textfield in awt(java). woulk you send me an example of time which can show time in standard format like H:M:S pls help me sir   Display time in JTextField import
Running JUnit
Running JUnit  Hi sir How can we run JUnit or Run test case Using JUnit using command prompt or CMD? Is there any alternate way of running test cases?   ou can run JUnit test case by running following command on CMD
time
time display only as hh:mm.  Hi. I have retrieved time from mysql database. its in th format hh:mm:ss. but i want to display only as hh:mm. wat to do?   Here is a jsp example that fetch the time from the database
time
time format hh:mm:ss  Hi. I have retrieved time from mysql database. its in th format hh:mm:ss. but i want to display only as hh:mm. wat to do?   Here is a jsp example that fetch the time from the database and display
time
time  Hi. I have retrieved time from mysql database. its in th format hh:mm:ss. but i want to display only as hh:mm. wat to do?   Here is a jsp example that fetch the time from the database and display in different
time
time  Hi. I have retrieved time from mysql database. its in th format hh:mm:ss. but i want to display only as hh:mm. wat to do?   Here is a jsp example that fetch the time from the database and display in different
Running JUnit
Running JUnit  Hi sir How can we run JUnit or Run test case Using JUnit using command prompt or CMD? Is there any alternate way of running test cases?   Hi friend You can run JUnit test case by running following
time
retrieved time from mysql database  Hi. I have retrieved time from.... wat to do?   Here is a jsp example that fetch the time from... is a jsp example that fetch the time from the database and display in different
Running core java program
Running core java program  I am jayesh raval. I am going to make simplae program and at the time of runnint that program I found class not found exception. I have clear source of that program and that is right in the syntax. so
Running Jar file in Windows
Running Jar file in Windows  Running Jar file in Windows
applet is running but no display
applet is running but no display  applet is running but no display.. its showing white screen with applet started
RUNNING EJB PROGRAMS
RUNNING EJB PROGRAMS  how to run ejb programs using weblogic in windowsxp
Running Java Applications as software
Running Java Applications as software   Please tell me what to do if you want your java application to run like a real software,eg a java GUI application that connects to the database(Mysql)running on the computer like any other
stop the running hidden server
stop the running hidden server  Port 8080 required by Tomcat v6.0 Server at localhost is already in use. The server may already be running in another process, or a system process may be using the port. To start this server you
running java with classpath in cygwin
running java with classpath in cygwin  The following command works in cmd.exe but failts in cygwin shell. java -cp .;oracle.jar;mysql.jar Executecmd query value; how should i alter the command to run in the bash shell?thanks
problem running a servlet on tomcat.
problem running a servlet on tomcat.  i have followed the steps given here. on typing "http://localhost:8080" i do get the apache tomcat page. i suppose that should mean that my tomcat server is up and running. but whn i try
While running jsp
While running jsp  I found this error when i run the client.jsp can anyone help me javax.xml.ws.WebServiceException: Failed to access the WSDL at: http://localhost:8080/WebService1/MyWebService?wsdl. It failed with: http
About running the Applet Program
About running the Applet Program  Hi I have composed an Applet Program and compiled the program, until that it is fine but how to run the Applet program(compiling i typed as javac AppletDemo.java)? Is compiling
About running the Applet Program
About running the Applet Program  Hi I have composed an Applet Program and compiled the program, until that it is fine but how to run the Applet program(compiling i typed as javac AppletDemo.java)? Is compiling
program is not running in Eclipse.... - WebSevices
program is not running in Eclipse....  Hi i following the tutorial for eclips in roseindia. I am able to creat the simple java application but when i am clicking windows->show view->console then i am getting the console
time ()
PHP time() Function The time() returns the current time  measured...;). Syntax of time() Function in PHP time(void) Parameter of time() Function in PHP void - void is optional parameter.  Example of time
applet running but no display - Applet
applet running but no display  Hai, Thanks for the post. I have applied the codebase url in the page and executed. Now, when accessed the page from a client, the page appears with a blank applet part (just whitescreen
Running and deploying Tomcat Server
Running and deploying Tomcat Server  HI Somebody has given the solution but it doesn't work out. kindly tell the solution for my problem which i described below I want to run a simple program on servlet and the application
About running the Tomcat Server
About running the Tomcat Server   HI I want to run a simple program on servlet and the application is a simple program Hello world to print on Internet browser. And the directory for servlet is like
Error running webservice
Error running webservice  Hi, I am getting following error: 05/10 12:45:46 ERROR org.springframework.web.context.ContextLoader - Context initialization failed org.springframework.beans.factory.BeanCreationException: Error
C++ program not running
", "November", "December"} ; int i, ans; unsigned int seed; seed=time(0); srand
Running problem with NoughtsAndCrossesGame in blank
Running problem with NoughtsAndCrossesGame in blank  Hi i was having problem created NoughtsAndCrossesGame in end the it works but i runs the gui in blank. Its another way to solve it /* * To change this template, choose
process of compiling and running java program
process of compiling and running java program  Explain the process of compiling and running java program. Also Explain type casting
Running the application
Running the Application      If you have completed previous steps of the application, this is the last step to see this application running on the browser. Just follow the steps
Running Java Applications as a Windows Service
Running Java Applications as a Windows Service  sample code for "Run a Java application as a Windows Service
VoIP Watch
VoIP Watch           Introduction of VoIP Watch VoIPWatch has learned that tomorrow GizmoProject will introduce their ?All Calls Free? program. According
Server running Button - Java Beginners
Server running Button  Hi there, I have a created a GUI using NetBeans IDE 6.1. The aim of this interface is to display the messages that have been recived by the server , when the client is connected , in the textArea
Building and Running Java 8 Support
Building and Running Java 8 Support  As you know Java 8 is already released and available for download. Now I am developer of Java based projects. So... 8 for compiling and running your applications. Check the tutorial for complete
Advertisements
 

 

 

DMCA.com