$.getJSON('http://api.wipmania.com/jsonp?callback=?', function (data) {
$("#hello").html('Latitude: ' + data.latitude +
'<br /> Longitude: ' + data.longitude +
'<br /> Country: ' + data.address.country);
});
I’m often used above code to get the latitude,longitude,country. But a lot of times it’s not working properly
Latitude: 0
Longitude: 0
Country: Unknown
Is there any better API to get those results?
I’ve always used smart-ip as a fallback for HTML5’s geolocation API, and never really had any problems with it?
FIDDLE
Google would also be a good alternative, but the TOS for Google Maps clearly states: