JQuery gets a small example of the IP address of the browser

  • 2020-03-26 23:47:27
  • OfStack


$(function () {
    $("#btnGetIP").click(function () {
        var jqxhr = $.getJSON("http://jsonip.appspot.com?callback=?",
            function (data) {
                alert(data.ip);
            })
        .error(function () { alert("error"); })
    });
});

Related articles: