一、引用
<script src="https://pv.sohu.com/cityjson?ie=utf-8"></script> <script src="https://ip.ws.126.net/ipquery"></script>
二、
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script> <script> var iPAddress = "", iPAttach = "";//IP地址,IP归属地 GetIPAll(); //获取IP地址,IP归属地 function GetIPAll() { iPAddress = returnCitySN["cip"];//IP地址: iPAttach = localAddress["province"] + localAddress["city"];//IP归属地 } </script>