I tried this on my pc and it showed the details there but when i used my phone to access the website and click the button and then i checked in the console of my pc, it didnt show anything and i couldnt see the user’s (my phone’s) lat long and stuff i can only see when i use my pc
Hi bro, I want just to run script.js only, not with IP, but after I upload it on hosting, permission always denied, I tried in different device but the error result still same, do you have suggestion?
If a user already or previously agrees to share his location or means we have its permission now we directly access its location,when the website is getting loaded , how can we implement that in javascript?
Here's an example of how to use the Geolocation API in HTML: ```html Geolocation Example function getLocation() { if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(showPosition); } else { alert("Geolocation is not supported by this browser."); } } function showPosition(position) { var latitude = position.coords.latitude; var longitude = position.coords.longitude; alert("Latitude: " + latitude + " Longitude: " + longitude); } Get Location ```