-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtime.html
More file actions
52 lines (45 loc) · 1.45 KB
/
time.html
File metadata and controls
52 lines (45 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<html>
<head>
<title></title>
<script type="text/javascript">
function srvTime() {
try {
//FF, Opera, Safari, Chrome
xmlHttp = new XMLHttpRequest();
} catch (err1) {
//IE
try {
xmlHttp = new ActiveXObject('Msxml2.XMLHTTP');
} catch (err2) {
try {
xmlHttp = new ActiveXObject('Microsoft.XMLHTTP');
} catch (eerr3) {
//AJAX not supported, use CPU time.
alert("AJAX not supported");
}
}
}
xmlHttp.open('HEAD', window.location.href.toString(), false);
xmlHttp.setRequestHeader("Content-Type", "text/html");
xmlHttp.send('');
return xmlHttp.getResponseHeader("Date");
}
//var st = srvTime();
//var date = new Date(st);
function display_c() {
var refresh = 1000; // Refresh rate in milli seconds
mytime = setTimeout('display_ct()', refresh)
}
function display_ct() {
var strcount
var st = srvTime();
var x = new Date(st); //new Date()
document.getElementById('ct').innerHTML = x;
tt = display_c();
}
</script>
</head>
<body onload=display_ct();>
<span id='ct'></span>
</body>
</html>