Using jQuery, this line will display your user's country code.
$.getJSON('https://freegeoip.net/json/', function(result) { alert(result.country_code); });
2.1m questions
2.1m answers
60 comments
57.0k users