$.get("http://ipinfo.io", function (response) { if(response.country == "US") display_us_message(); else if(response.country == "TR") display_turkey_message(); else display_generic_message(); }, "jsonp");