js realizes that PC terminal locates the current urban geographical position according to IP
- 2021-07-22 09:02:56
- OfStack
Without saying much, please look at the code:
<script type="text/javascript">
$.getScript('http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js', function(_result) {
if (remote_ip_info.ret == '1') {
alert(' Country: ' + remote_ip_info.country +'\n Provinces: ' + remote_ip_info.province + '\n City: ' + remote_ip_info.city + '\n District: ' + remote_ip_info.district + '\nISP : ' + remote_ip_info.isp + '\n Type: ' + remote_ip_info.type + '\n Others: ' + remote_ip_info.desc);
} else {
alert(' No match was found IP Address information! ');
}
});
</script>