Find User Location using Free Geo IP
get Current Location
by Anand Jee
HTML
<div id="result"></div>
JavaScript
$(document).ready(function() {
$.ajax({
url: 'http://freegeoip.net/json/',
dataType: 'jsonp',
cache: true,
jsonp: 'callback',
success: function(data) {
$('#result').append('Estimated city: ' + data.city + '<br>Estimated LatLng: ' + data.latitude + ', ' + data.longitude);
},
error: function() {
$('#result').append('geolocation not supported');
}
});
});