-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
34 lines (29 loc) · 918 Bytes
/
index.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
<html>
<head>
<link rel="stylesheet" type="text/css" href="css/style.css">
<script>
function showResult() {
var str = document.getElementById("zipcode").value;
document.getElementById("txtResult").innerHTML = "";
if (window.XMLHttpRequest) {
xmlhttp = new XMLHttpRequest();
} else {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
document.getElementById("txtResult").innerHTML = xmlhttp.responseText;
}
}
xmlhttp.open("GET","result.php?zipcode="+str,true);
xmlhttp.send();
}
</script>
</head>
<body>
<input type="text" name="zipcode" id="zipcode" required placeholder = "Input zipcode">
<button onclick="showResult()">Search</button>
<hr>
<div id="txtResult"><b>Result will be listed here...</b></div>
</body>
</html>