Skip to content

Instantly share code, notes, and snippets.

@Alaaba98
Forked from yokesharun/get_ip_address.js
Created October 20, 2018 19:17
Show Gist options
  • Save Alaaba98/20b44d990cb6bae39b85b37a28488173 to your computer and use it in GitHub Desktop.
Save Alaaba98/20b44d990cb6bae39b85b37a28488173 to your computer and use it in GitHub Desktop.
Get your ip with Jquery
$.get("http://ipinfo.io", function(response) {
alert(response.ip);
}, "jsonp");
$(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