W3C Geolocation API: Difference between revisions

Content deleted Content added
Line 27:
===Example code===
Simple [[JavaScript]] code that checks if the browser has the Geolocation API implemented and then uses it to get the current position of the device. this code creates a function which can be called on HTML using <code><body onload="geoFindMe()"></code>:
<syntaxhighlight lang="javascript">7nyfgvgcvuw8qnib2yecbuefbvvyefbcegybcdedghc dshj
const geoFindMe = () => {
if (navigator.geolocation) {