Javascript examples for jQuery Method and Property:jQuery Method Example
Location.country_code from freegeoip.net
<!doctype html> <html> <head></head> <body> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function() { $.getJSON('http://freegeoip.net/json/?callback=?', function(location) { console.log( location.country_name ); });/*from w w w. java 2 s . c o m*/ }); </script> </body> </html>