利用google提供的API(JavaScript接口)获取网站访问者IP地理位置的代码详解_javascript技巧

WBOY
Release: 2016-05-16 18:22:24
Original
1333 people have browsed it

首先引入JavaScript API文件



此API提供的接口共有6个,geoip_country_code(){国家代码},geoip_country_ name(){国家名称},geoip_city() {城市名称},geoip_region(){地区代码},geoip_latitude(){经度},geoip_longitude(){纬度}。

其中地区代码为MaxMind内部使用的一种代码,各国省级行政区按音序排列给出的编号,通过某些方法可以转化为行政区名称。

使用实例:

复制代码代码如下:




JavaScript API






Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!