-
Notifications
You must be signed in to change notification settings - Fork 0
/
tw.html
45 lines (42 loc) · 903 Bytes
/
tw.html
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
<html>
<head>
<style type="text/css">
body {font-family: sans-serif}
</style>
<script type="text/javascript">
function showtw(str)
{
if (str.length==0)
{
document.getElementById("twop").innerHTML="";
return;
}
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("twop").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","gettw.php?q="+str,true);
xmlhttp.send();
}
</script>
</head>
<body>
<form align="center">
Enter City name:<input type="text" id="txt1"
onkeyup="showtw(this.value)">
</form>
<br />
<div id="twop" align="center">Current city time information will be displayed here.</div>
</body>
</html>