Geo Location information

by Naresh

HTML

<div>Country: <span id="country"></span>
  <div>State: <span id="state"></span>
    <div>City: <span id="city"></span>
      <div>Latitude: <span id="latitude"></span>
        <div>Longitude: <span id="longitude"></span>
          <div>IP: <span id="IPv4"></span>

JavaScript

$.getJSON('https://geoip-db.com/json/geoip.php?jsonp=?')
  .done(function(location) {
    $('#country').html(location.country_name);
    $('#state').html(location.state);
    $('#city').html(location.city);
    $('#postal').html(location.postal);
    $('#latitude').html(location.latitude);
    $('#longitude').html(location.longitude);
    $('#ip').html(location.IPv4);
  });