Created
June 17, 2017 09:35
-
-
Save ferblape/d855490597f0b774e6911c8ac7324346 to your computer and use it in GitHub Desktop.
JQuery free IP geolocation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function(){ | |
$.getJSON("http://jsonip.com/?callback=?", function (ipData) { | |
$.getJSON("https://freegeoip.net/json/" + ipData.ip, function (geoData) { | |
console.log(geoData.city); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment