geo1.html 604 B

12345678910111213141516171819202122
  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. <p><a href="geo2.html">Next</a></p>
  12. </body>
  13. <script>
  14. document.getElementById('geo').innerHTML = navigator.geolocation ?
  15. 'Geolocation API is available' :
  16. 'Geolocation API is not available';
  17. </script>
  18. </html>