Using the interface program of QQ
<script type=text/Web page special effects src=http://fw.qq.com/ipaddress charset= "gb2312" ></script>
<script type=text/Web page Special effects >
document.write (Ipdata.join ('));
</script>
202.105.128.73, Shenzhen, Guangdong province
<script Type=text/javascript src=http://fw.qq.com/ipaddress></script>
<script type=text/javascript>
document.write
(ipdata[2]);d ocument.write (ipdata[3]);
</script>
Shenzhen city, Guangdong province
Now let's take a look at a Google API to get User IP address details.
<meta http-equiv= "Content-type" content= text/html; "/>
<title>javascript api</title>
<script type=" Text/javascript "src=" http://j.maxmind.co M/app/geoip. Web Effects "></script>
<body>
<script type=" Text/javascript ">
var area = "";
Try
{
if (geoip_city ()!= "" && geoip_city ()!= null)
Area + = geoip_city () + ",";
if (geoip_region_name ()!= "" && geoip_region_name ()!= null)
Area + = Geoip_region_name () + ",";
if (geoip_country_name ()!= "" && geoip_country_name ()!= null)
Area + = Geoip_country_name ();
}
catch (Err)
{
Area= "";
}
</script>
</body>
The API provides a total of 6 interfaces, Geoip_country_code () {Country Code},geoip_country_ name () {Country name},geoip_city () {city name},geoip_region () {Region code}, Geoip_latitude () {longitude},geoip_longitude () {latitude}.
Where the region code for Maxmind internal use of a code, the provincial-level administrative districts by sequencer the number given