引入搜狐获取位置的 js,PC 端不太准确,移动端安卓,iOS, 试了都正常javascript
1 <script typet="text/javascript" async="async" src="https://pv.sohu.com/cityjson?ie=utf-8"></script>
引入后会获得省市名,以下java
1 var returnCitySN = {"cip": "124.89.86.45", "cid": "610100", "cname": "陕西省西安市"};
需求复杂的话就建议用高德和百度的api 了。 json
以上api