IP to Location using Javascript

后端 未结 13 1402
死守一世寂寞
死守一世寂寞 2020-11-27 03:46




        
13条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-27 04:13

    A better way is to skip the "middle man" (ip)

    jQuery.get("http://ipinfo.io", function(response) {
        console.log(response.city);
    }, "jsonp");
    

    This gives you the IP, the city, the country, etc

提交回复
热议问题