<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript"
href="<%=request.getContextPath()%>/js/jquery-1.9.1.js"></script>
<script src="http://pv.sohu.com/cityjson?ie=utf-8"></script>
<script type="text/javascript">
function msg() {
alert(returnCitySN["cip"] + ',' + returnCitySN["cname"]);
alert(navigator.userAgent);
alert(navigator.platform);
alert(navigator.appName);
}
</script>
<script type="text/javascript" src="http://counter.sina.com.cn/ip/" charset="gb2312"></script> <!--获取接口数据,注意charset -->
<script type="text/javascript">
document.writeln("IP地址:"+ILData[0]+"<br />"); //输出接口数据中的IP地址
document.writeln("地址类型:"+ILData[1]+"<br />"); //输出接口数据中的IP地址的类型
document.writeln("地址类型:"+ILData[2]+"<br />"); //输出接口数据中的IP地址的省市
document.writeln("地址类型:"+ILData[3]+"<br />"); //输出接口数据中的IP地址的
document.writeln("地址类型:"+ILData[4]+"<br />"); //输出接口数据中的IP地址的运营商
</script>
</head>
<body>
<h1>欢迎你!!!</h1>
<h3>抓取消息</h3>
<h3>
<a href="<%=request.getContextPath()%>/accessuser/msg">测试获取信息</a>
</h3>
<h3><label οnclick="msg()">通过js获取信息</label></h3>
</body>
</html>
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript"
href="<%=request.getContextPath()%>/js/jquery-1.9.1.js"></script>
<script src="http://pv.sohu.com/cityjson?ie=utf-8"></script>
<script type="text/javascript">
function msg() {
alert(returnCitySN["cip"] + ',' + returnCitySN["cname"]);
alert(navigator.userAgent);
alert(navigator.platform);
alert(navigator.appName);
}
</script>
<script type="text/javascript" src="http://counter.sina.com.cn/ip/" charset="gb2312"></script> <!--获取接口数据,注意charset -->
<script type="text/javascript">
document.writeln("IP地址:"+ILData[0]+"<br />"); //输出接口数据中的IP地址
document.writeln("地址类型:"+ILData[1]+"<br />"); //输出接口数据中的IP地址的类型
document.writeln("地址类型:"+ILData[2]+"<br />"); //输出接口数据中的IP地址的省市
document.writeln("地址类型:"+ILData[3]+"<br />"); //输出接口数据中的IP地址的
document.writeln("地址类型:"+ILData[4]+"<br />"); //输出接口数据中的IP地址的运营商
</script>
</head>
<body>
<h1>欢迎你!!!</h1>
<h3>抓取消息</h3>
<h3>
<a href="<%=request.getContextPath()%>/accessuser/msg">测试获取信息</a>
</h3>
<h3><label οnclick="msg()">通过js获取信息</label></h3>
</body>
</html>