jQuery with IPInfo API

  • Ads

jQuery with IPInfo API

Postby tumble » Fri Mar 19, 2010 12:38 pm

I just wanted to let the community know that I hacked together a little jQuery script that loads information from the IPInfo api. You can see the code at my blog: http://there4development.com/2010/03/geolocation-services-with-jquery-and-ipinfodb/

And you can see a demo at: http://there4development.com/projects/geolocation/
tumble
 
Posts: 1
Joined: Fri Mar 19, 2010 12:29 pm

Re: jQuery with IPInfo API

Postby marchost » Fri Mar 19, 2010 5:25 pm

Great, I put a link to your blog on this page : http://ipinfodb.com/ip_location_api_json.php

Thanks
Marc
marchost
Site Admin
 
Posts: 373
Joined: Wed Apr 08, 2009 9:55 pm

Re: jQuery with IPInfo API

Postby marchost » Tue Apr 20, 2010 11:02 am

Hi, I found a way working around the ip_proxy.php

$.getJSON("http://ipinfodb.com/ip_query.php?output=json&callback=?",
function(data){
alert(data['CountryCode']);
});

http://api.jquery.com/jQuery.getJSON/ :

If the URL includes the string "callback=?" in the URL, the request is treated as JSONP instead. See the discussion of the jsonp data type in $.ajax() for more details.
marchost
Site Admin
 
Posts: 373
Joined: Wed Apr 08, 2009 9:55 pm


Return to IP geolocation API related



Who is online

Users browsing this forum: bhukkel, Yahoo [Bot] and 1 guest