Open borisNG opened 6 years ago
You can get the user's country code through the following code:
$(document).ready(function () { var url = "https://ipinfo.io/country"; $.get(url, function (countryCode) { alert(countryCode); //For example show "IR" }); });
Then pass the value to the input before loading the page:
data-selected-country="IR"
is it possible to pre-select user's country based on an external ip provider like https://ipinfo.io/pricing ?