Created
May 4, 2017 04:43
-
-
Save jonathanwork/83f409c5319144e181caf19c9f312de7 to your computer and use it in GitHub Desktop.
getting ip address of the current page
This file contains 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
$.getJSON( "//freegeoip.net/json/" + window.location.host + "?callback=?", function(data) { | |
console.warn('Fetching JSON data...'); | |
// Log output to console | |
console.info(JSON.stringify(data, null, 2)); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment