geo1.html 563 B

1234567891011121314151617181920
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  4. <title>Geolocation demo step 1</title>
  5. </head>
  6. <body>
  7. <h1>Step 1: check availability of the Geolocation API</h1>
  8. <p>As a first step, let us just check whether the HTML5 Geolocation API is
  9. present in this browser or not.</p>
  10. <div id="geo"></div>
  11. </body>
  12. <script>
  13. document.getElementById('geo').innerHTML = navigator.geolocation ?
  14. 'Geolocation API is available' :
  15. 'Geolocation API is not available';
  16. </script>
  17. </html>