You can just use the HTML5 geolocation api. However, it will prompt users if they want to share their location with your app. Most will say "no". It's also not that accurate unless using gps on a mobile device. Most likely it will return the location of your ISP, not where you actually are (unless using gps)