JS
<!--下面一个开放的JS中有一个方法可以获取当前IP地址--><script src="/cityjson?ie=utf-8"></script><script type="text/javascript">$(function (){alert(1111);var ip=""; //所属的IPvar cityAndAddress=""; //登录的地区$(function () {//获取IP,页面加载的时候自动执行ip=returnCitySN["cip"];$.ajax({url: 'http://api./location/ip?ak=xxxx',type: 'POST',dataType: 'jsonp',success:function(data) {//获取城市cityAndAddress=data.content.address_detail.province + "," + data.content.address_detail.city;//alert("IP:"+ip);//alert("cityAndAddress:"+cityAndAddress);$("#address").text(cityAndAddress);$("#ip").text(ip);}});})})</script>