代码是用的搜狐的ip接口,在准备显示IP的地方添加以下代码即可。
<div style="background-color: #b7b1f2;"> 你的<a href="http://www.wzzy.top/tag/ip" title="查看更多关于IP的文章" target="_blank">IP</a>:<script src="//pv.sohu.com/cityjson?ie=utf-8"></script> <script type="text/javascript"> document.write(returnCitySN["cip"]) </script></div>
#b7b1f2为背景颜色,不喜欢的请自行更换。颜色代码对照表