Created
October 8, 2023 13:47
-
-
Save macmladen/48f41c84b9ac22762b98e3bd3feb12c1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// International data based on browser preference | |
Intl.DateTimeFormat().resolvedOptions() | |
// Timezone offset to UTC | |
(new Date()).getTimezoneOffset() | |
// Array from browser | |
navigator.languages | |
// Language Attribute if page has it | |
document.querySelector('html').getAttribute('lang') | |
// Use Geolocation API | |
// https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/getCurrentPosition | |
// getCurrentPosition(success, error, options) | |
navigator.geolocation.getCurrentPosition(console.log) | |
// Reverse geolocate lat/long | |
https://geocode.maps.co/reverse?lat=55.7086421&lon=13.188364 | |
// Google API | |
// https://stackoverflow.com/a/41276025/1099667 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment