Get geographical location (geolocation) by IP address using jQuery

29 Dec

In my last post i wrote about how to get IP address in javascript. Now i am writing about how to get geoloaction by IP address. I have merged the code of previous post.

The code sample:

var clientip = data.ip;
var url =””+clientip+”?callback=?”;
jQuery.getJSON(url, function(data){
$.each(data, function(key, val) {
alert(key+’ : ‘+val);

Leave a comment

Posted by on December 29, 2011 in javascript, jQuery


Tags: , , ,

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: