Skip to content

Instantly share code, notes, and snippets.

@chluehr
Created July 14, 2011 09:20
Show Gist options
  • Save chluehr/1082158 to your computer and use it in GitHub Desktop.
Save chluehr/1082158 to your computer and use it in GitHub Desktop.
Query ipinfodb via jquery / JSONP
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script>
$.getJSON("http://api.ipinfodb.com/v3/ip-country/?key=API_KEY_HERE&format=json&callback=?",
function(data){
alert(data['countryCode']); //DE,AT ...
});
</script>
</head>
<body>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment