dimanche 24 décembre 2017

How to get user location and sent back to server on webpages?

I want to get users location via the Google location api and send back to my server (so that I can know where the user is).

But I don't know how to make the users browser sent a POST request to Google and send the answer to my server, on AJAX/JavaScript

(The reason I must request Google Location API : I want to get the exact location of the user by only ip , but most of ip2location database just accurate to the city. And the Google Location API can accurate to 3km range)

If possible, please give me an example code with explanation Thanks for you helping!




Aucun commentaire:

Enregistrer un commentaire