Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixing geolocation detect

  • Loading branch information...
commit b5f5adfba561c32300ca17c78b7f82d15eedf669 1 parent 6d2e9e0
@jonathantneal authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 detect.html
View
4 detect.html
@@ -375,10 +375,10 @@ <h2 id=geolocation>Geolocation</h2>
</div>
</div>
-<p>Checking for geolocation support uses <a href=#techniques>detection technique #1</a>. If your browser supports the geolocation <abbr>API</abbr>, there will be a <code>geolocation</code> property on the global <code>navigator</code> object. If your browser doesn&#8217;t support the geolocation <abbr>API</abbr>, the <code>geolocation</code> property will be undefined. Here&#8217;s how to check for geolocation support:
+<p>Checking for geolocation support uses <a href=#techniques>detection technique #1</a>. If your browser supports the geolocation <abbr>API</abbr>, there will be a <code>geolocation</code> property on the global <code>navigator</code> object. If your browser doesn&#8217;t support the geolocation <abbr>API</abbr>, the <code>geolocation</code> property will not be present inside of <code>navigator</code>. Here&#8217;s how to check for geolocation support:
<pre><code>function supports_geolocation() {
- return !!navigator.geolocation;
+ return 'geolocation' in navigator;
}</code></pre>
<p>Instead of writing this function yourself, you can use <a href=#modernizr>Modernizr</a> to detect support for the geolocation <abbr>API</abbr>.
Please sign in to comment.
Something went wrong with that request. Please try again.