W3C Geolocation API: Difference between revisions

Content deleted Content added
Citation bot (talk | contribs)
Removed parameters. | You can use this bot yourself. Report bugs here. | Activated by Neko-chan | Category:Application programming interfaces | via #UCB_Category
m Task 70: Update syntaxhighlight tags - remove use of deprecated <source> tags
Line 26:
===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>:
<sourcesyntaxhighlight lang="javascript">
const geoFindMe = () => {
if (navigator.geolocation) {
Line 52:
timeout: 27000
};
</syntaxhighlight>
</source>
 
==See also==