A method that is is so simple that can be used to detect the country (no need to use php to find out your ip) of the user who is entering our site is using the API of wipmania via jQuery. The query method returns to us a few parameters such as latitude, longitude, zoom, address, city, country, the country code, region.
If we introduce directly in our browser the url “http://api.wipmania.com/jsonp?callback =?” And we look at the data returned. You only need to use JSON to retrieve with jQuery as follows:
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script>
$.getJSON('http://api.wipmania.com/jsonp?callback=?', function (data) {
alert('País: ' + data.address.country);
});
</script>
Incoming search terms:
- jquery detect country
- detect country jquery
- jquery get user country
- jquery to detect browser country
- jquery country detection
- get user country jquery
- jquery get users country
This doesn’t work, update the post please, i need to detect country