Get IP address information using jQuery
jqIpLocation is a jQuery Plugin that returns the location of an IP address in JSON format. You can get country, country code, city name, region name, latitude and longitude information about IP address location.
How to use it?
First, download the jqIpLocation.js file and put its reference along with jQuery library. And then add the Javascript that will returns you IP Location information in JSON format.
$.jqIpLocation({ ip : '173.194.36.50', success: function(location) { alert(location.countryName); alert(location.countryCode); } });
Properties
The callback function return an object which hold various properties.
- location.countryName : Country Name
- location.countryCode : Country Code
- location.cityName : City Name
- location.regionName : Region Name
- location.latitude : Latitude
- location.longitude : Longitude
Note, the option "IP" is compulsory.
Feel free to contact me for any help related to jQuery, I will gladly help you.