المعرفة:: JavaScript الحالة::مؤرشفة المراجع:: The Complete JavaScript Course 2022 From Zero to Expert, https://developer.mozilla.org/en-US/docs/Web/API/Geolocation_API, https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/getCurrentPosition
- The Geolocation API allows the user to provide their location to web applications if they so desire.
getCurrentPosition()
Geolocation.getCurrentPosition()
: Retrieves the device’s current location.- It takes two parameters, a callback function to run on success and another one on failure.
- The success callback function takes a GeolocationPosition object as its sole input parameter.