-
Notifications
You must be signed in to change notification settings - Fork 4
/
index.html
26 lines (26 loc) · 843 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
<!DOCTYPE html>
<html lang="en">
<head>
<script src="dist/geotz.js"></script>
</head>
<body>
<h1>Querying time zone data with HTTP Range Requests</h1>
<p><a href="https://github.com/kevmo314/browser-geo-tz">GitHub Repo</a></p>
<div>
<input type="text" id="lat" value="38.08122" />
<input type="text" id="lng" value="-86.45791" />
<button id="btn">Find</button>
</div>
<pre id="result"></pre>
<script>
var btn = document.getElementById("btn");
btn.addEventListener("click", function () {
var lat = document.getElementById("lat").value;
var lng = document.getElementById("lng").value;
GeoTZ.find(lat, lng).then(function (tz) {
document.getElementById("result").innerHTML = JSON.stringify(tz);
});
});
</script>
</body>
</html>