瀏覽代碼

First commit: check Geolocation API.

Frederic G. MARAND 10 年之前
當前提交
97c604816b
共有 1 個文件被更改,包括 20 次插入0 次删除
  1. 20 0
      geo1.html

+ 20 - 0
geo1.html

@@ -0,0 +1,20 @@
+<html>
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+    <title>Geolocation demo step 1</title>
+    </head>
+
+  <body>
+    <h1>Step 1: check availability of the Geolocation API</h1>
+    <p>As a first step, let us just check whether the HTML5 Geolocation API is
+      present in this browser or not.</p>
+
+    <div id="geo"></div>
+    </body>
+
+  <script>
+    document.getElementById('geo').innerHTML = navigator.geolocation ?
+      'Geolocation API is available' :
+      'Geolocation API is not available';
+    </script>
+  </html>