title: How do I use ipstack and ajax to get the country code of a user?
body: <p>I am using <a href="https://ipstack.com" rel="nofollow noreferrer">https://ipstack.com</a> to geolocate users so I can show a popup based on country. I am trying to grab the country code, but so far all I get is undefined.</p>
  
  <pre><code>    jQuery.ajax({
          url: 'https://api.ipstack.com/check?access_key=MY_API_KEY&amp;fields=country_code',
          dataType: 'jsonp',
          success: function(json){
              alert(json.country_code);
          }
      });
  </code></pre>
  
  <p>I expect this to return the country code "US" since I'm in the US, but it just returns "undefined" instead.</p>