H
H
hbrmdc2015-11-02 22:48:52
JavaScript
hbrmdc, 2015-11-02 22:48:52

Is it possible to run satelize from the front?

Is it possible to run this library or something similar to get the client's country code on the front?
https://www.npmjs.com/package/satelize

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
fastec, 2015-11-12
@fastec

$.get("http://ipinfo.io", function(response) {
    console.log(response.city, response.country);
}, "jsonp");

Please note that not https is used. If you call from https, it may swear at an attempt to execute unsafe code.
jsfiddle.net/zK5FN/2
Or you can ping some of your service and it will already answer you (based on ip) which country, but you need to write this service yourself.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question