Created
February 8, 2016 13:30
-
-
Save yokesharun/3c3455776c1204defa3e to your computer and use it in GitHub Desktop.
Get your ip with Jquery
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
$.get("http://ipinfo.io", function(response) { | |
alert(response.ip); | |
}, "jsonp"); |
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 (data) { | |
console.log(data); | |
alert(data.ip); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment