summaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qmltests/data/geolocation.html
blob: c095a6b9ed8d802e14ee2a01dccee2dd335a6eb5 (plain)
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
<html>
<head>
<title>Geolocation Permission API Test</title>
<script>

function successHandler(location) {
    var message = document.getElementById("message");
    message.innerHTML = "Latitude: " + location.coords.latitude +
    "<br>Longitude: " + location.coords.longitude;

}

function errorHandler(error) {
    console.error(error.message);
}

<!-- One shot example -->
navigator.geolocation.getCurrentPosition(successHandler, errorHandler);

</script>
</head>
<body>
<div id="message">Location unknown</div>
</body>
</html>