How does js get the user's current province name?

js how to get the name of the province where the current user is located, as long as the province asks for advice from its seniors!


get


from Baidu map api.

you can get the user's ip address first, and then his province from the ip address, but this is not very accurate

you can use the html5 feature Geolocation to obtain latitude and longitude, and you are trying to find a way to turn latitude and longitude into a province
. This will pop up a box that allows users to agree to
http://www.w3school.com.cn/ht.

of geographic location information.

those maps api are just these two ways, but those maps api will help you convert ip or latitude and longitude into provinces
Gaud: https://lbs.amap.com/getting-.
Baidu: http://lbsyun.baidu.com/locat.

.
Menu