{"id":150,"date":"2013-10-17T16:13:56","date_gmt":"2013-10-17T08:13:56","guid":{"rendered":"http:\/\/www.datarelab.com\/blog\/?p=150"},"modified":"2015-01-18T19:39:33","modified_gmt":"2015-01-18T11:39:33","slug":"html5-%e9%80%9a%e8%bf%87js%e8%8e%b7%e5%8f%96%e5%9c%b0%e7%90%86%e5%ae%9a%e4%bd%8d%ef%bc%88gps%ef%bc%89","status":"publish","type":"post","link":"https:\/\/www.datarelab.com\/blog\/Technical_literature\/150.html","title":{"rendered":"HTML5 - \u901a\u8fc7JS\u83b7\u53d6\u5730\u7406\u5b9a\u4f4d\uff08GPS\uff09"},"content":{"rendered":"<pre class=\"brush:html; toolbar: true; auto-links: true;\">&lt;script&gt;\r\nvar x=document.getElementById(\"demo\");\r\nfunction getLocation()\r\n  {\r\n  if (navigator.geolocation)\r\n    {\r\n    navigator.geolocation.getCurrentPosition(showPosition);\r\n    }\r\n  else{x.innerHTML=\"Geolocation is not supported by this browser.\";}\r\n  }\r\nfunction showPosition(position)\r\n  {\r\n  x.innerHTML=\"Latitude: \" + position.coords.latitude +\r\n  \"&lt;br \/&gt;Longitude: \" + position.coords.longitude;\r\n  }\r\n&lt;\/script&gt;<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>&lt;script&gt; var x=document.getElementById(\"demo\"); f [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[167],"class_list":["post-150","post","type-post","status-publish","format-standard","hentry","category-Technical_literature","tag-html"],"views":1932,"_links":{"self":[{"href":"https:\/\/www.datarelab.com\/blog\/wp-json\/wp\/v2\/posts\/150","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.datarelab.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.datarelab.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.datarelab.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.datarelab.com\/blog\/wp-json\/wp\/v2\/comments?post=150"}],"version-history":[{"count":0,"href":"https:\/\/www.datarelab.com\/blog\/wp-json\/wp\/v2\/posts\/150\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.datarelab.com\/blog\/wp-json\/wp\/v2\/media?parent=150"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.datarelab.com\/blog\/wp-json\/wp\/v2\/categories?post=150"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.datarelab.com\/blog\/wp-json\/wp\/v2\/tags?post=150"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}