Skip to content

Commit f517efb

Browse files
committed
test get location
1 parent 459e296 commit f517efb

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

test/index.html

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,15 @@
99
</head>
1010

1111
<body>
12-
<a href="./index1.html">123</a>
13-
<input type="hidden" id="refreshed" value="no">
12+
TEST
1413
</body>
1514
<script>
16-
17-
onload = function () {
18-
var e = document.getElementById("refreshed");
19-
if (e.value == "no") {
20-
e.value = "yes";
21-
} else {
22-
e.value = "no";
23-
location.reload();
24-
}
25-
}
15+
navigator.geolocation.getCurrentPosition(function (position) {
16+
longitude = position.coords.longitude;
17+
latitude = position.coords.latitude;
18+
alert(longitude);
19+
alert(latitude);
20+
})
2621
</script>
2722

2823
</html>

0 commit comments

Comments
 (0)