Mike's JavaScript and AJAX

Digital Clock - Update with AJAX

Server Time
Local Time

  I wrote this JavaScript and AJAX code to timeout after 8 minutes of AJAX calls which is about 500 requests to the server. That way the folks who run the server won't get angry at me for using too much bandwidth.

The timer on the first line is the clock on the remote server. It is updated once every second by the AJAX code. The AJAX code calls this PHP program on the server to update the server time.

The timer on the second line is the clock on your local PC and is updated using system calls to the time functions.

I also created this page which does the same thing but gets the clock information as XML.

 
 
Debug Box:
ajax should replace this text with the results of gen_html_data.php
Requests made so far:unknown
Max requests allowed:unknown
Calls remaining:unknown
 

Home