jquery get ip

JavaScript
$.getJSON("https://api.ipify.org/?format=json", function(e) {
    console.log(e.ip);
});
//Not included in the source, "api" can be changed to "api6" for IPv6
//addresses.
Source

Also in JavaScript: