Get IP address information using jQuery

In this post, you will learn how can you get all the details of an IP Address using jQuery. IP address is nothing but address of any computer located some where in the world. The jQuery code will return Country name, country code, city name, latitude and longitude details about the IP Address.

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.
  ip : '',
  success: function(location) {             


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.

Nothing shocks me, I'm a Software Engineer. And I am not young enough to know everything. I live in World Wide Web and from there take care of this website. This website communicates about my work, learning and experience. I believe life is short, and it is for loving, sharing, learning and connecting. So lets connect..