搜狐IP地址查询接口(默认GBK):http://pv.sohu.com/cityjson
搜狐IP地址查询接口(可设置编码):http://pv.sohu.com/cityjson?ie=utf-8
效果:
代码:
<script src="http://pv.sohu.com/cityjson?ie=utf-8"></script>
<!--使用了JQuery,需要导入JS-->
<script src="${pageContext.request.contextPath}/js/jquery-1.7.2.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(function () {