jQuery获得客户端/浏览器的IP地址信息
来源:互联网 发布:同学录制作软件 编辑:程序博客网 时间:2024/06/08 11:03
通过http://ipinfo.io网站api获得ip地址的详细信息,实现网站中英文切换。可能还有更多的网站提供ip查询,不过个人觉得http://ipinfo.io比较简单、实用。
了解更多,请参考网站:http://ipinfo.io/developers
提供另外两种办法:
1. jsonip.com: is a free utility service that returns a client's IP address in a JSON object with support for JSONP, CORS, and direct requests. It serves millions of requests each day for websites, servers, mobile devices and more from all around the world.
All you need to do is to make a call to jsonip.com.
$(document).ready(function () {
$.get('http://jsonip.com', function (res) {
$('p').html('IP Address is: ' + res.ip);
});
});
2. Smart-IP.net: Smart IP for today is one of the leading services providing to it's users all the required information about IP-addresses and everything related to them.
$(document).ready(function () {
$.getJSON('http://smart-ip.net/geoip-json?callback=?', function(data) {
$('p').html('My IP Address is: ' + data.host);
});
});
Along with the IP address, this service also provide Geo location details as well like Country, latitude, longitude etc. Following are the properties which are returned as JSON response by this service.
data.host;
data.countryName;
data.countryCode;
data.city;
data.region;
data.latitude;
data.longitude;
data.timezone;
- jQuery获得客户端/浏览器的IP地址信息
- 获得客户端浏览器信息
- 如何获得客户端的ip地址
- JSP获得客户端的IP地址
- 如何获得客户端的ip地址
- 如何获得客户端的ip地址?
- 获得客户端真实IP地址的方法
- 如何获得客户端的IP地址
- PHP获得客户端真实的IP地址
- 获得客户端真实IP地址的方法
- SpringMVC获得客户端的IP地址(草稿)
- tornado获得客户端设备信息和ip地址
- WCF服务如何获得客户端IP地址信息
- asp.net 获取客户端浏览器,ip地址,操作系统信息
- asp.net 获取客户端浏览器,ip地址,操作系统信息
- Servlet-request获取客户端ip地址,操作系统,浏览器等信息
- 获取客户端的IP地址等信息
- 通过新浪IP服务器获得的当前客户端IP地址对应的国家、省份或直辖市、城市信息
- Eclipse背景颜色修改
- java中Keytool的使用总结
- cocos2dx 3.4之旅
- Android 百度定位SDK配置和实现当前位置定位
- 【SCOI2010】【BZOJ1853】幸运数字
- jQuery获得客户端/浏览器的IP地址信息
- Linux Makefile多目录的编写
- Android 简单实现圆形ImageView添加双层圆形边框
- 学《何以》五招收服女友心
- 递归学习(一)--判断回文字符串
- Core Animation详解(三)-UIDynamic Animation
- 开源ECSHOP中SQL SELECT操作集锦,练习SQL
- 01背包问题和完全背包问题
- 数据结构(陈越)PAT练习题 第五周:图(上)