tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

position.html (660B)


      1 <!DOCTYPE html>
      2 <html lang="en" dir="ltr">
      3 <head>
      4  <script type="text/javascript">
      5    var result = null;
      6 
      7    function handlePosition(position) {
      8      result.innerHTML = position.coords.latitude + " " + position.coords.longitude;
      9    }
     10 
     11    function handleError(error) {
     12      result.innerHTML = error.message;
     13    }
     14 
     15    function init() {
     16      result = document.getElementById("result");
     17 
     18      if (navigator.geolocation)
     19        navigator.geolocation.getCurrentPosition(handlePosition, handleError);
     20      else
     21        result.innerHTML = "not available";
     22    }
     23 
     24  </script>
     25 </head>
     26 <body onload="init()">
     27  <p id="result">location...</p>
     28 </body>
     29 </html>