wefra/lib/intl-tel-input-master/examples/js/defaultCountryIp.js.ejs

12 lines
423 B
Plaintext

var input = document.querySelector("#phone");
window.intlTelInput(input, {
initialCountry: "auto",
geoIpLookup: function(callback) {
$.get('https://ipinfo.io', function() {}, "jsonp").always(function(resp) {
var countryCode = (resp && resp.country) ? resp.country : "";
callback(countryCode);
});
},
utilsScript: "../../build/js/utils.js?<%= time %>" // just for formatting/placeholders etc
});