📄 index.jsp
字号:
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>IP地址查询</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<script type="text/javascript" src="${pageContext.request.contextPath}/js/xmlhttp.js"></script>
<style type="text/css">
a:link, a:visited {
text-decoration : none;
}
* {
font-size: 14px;
font-family: tahoma;
}
</style>
<script type="text/javascript">
function getIp(){
var form = document.getElementById("ip");
var ip = form.value;
var viewobj = document.getElementById("ipResult");
viewobj.innerHTML = "正在检测中...";
send_request(function(value){viewobj.innerHTML=value},
'<html:rewrite action="/obtain"/>?ip='+ ip, true);
}
function getWeather(){
var form = document.getElementById("cityCode");
var cityCode = form.value;
var viewobj = document.getElementById("weatherResult");
viewobj.innerHTML = "正在检测中...";
send_request(function(value){viewobj.innerHTML=value},
'<html:rewrite action="/obtain"/>?method=ObtainWeather&cityCode='+ cityCode, true);
}
</script>
</head>
<body>
<div>
<font>欢迎来自${messageIp}朋友</font><br><br><br>
今天天气:XXX <img src="XXX" alt="天气状况图">
</div><br><br>
<table cellpadding="10" cellspacing="10" border="0">
<tr>
<th>IP归属于查询</th>
</tr>
<tr>
<th>
<input type="text" id="ip"/><input type="button" value="query" id="ipQuery" onclick="javascript:getIp()"/>
<div id="ipResult"></div>
</th>
</tr>
<tr><th></th></tr><tr><th></th></tr>
<tr>
<th>天气预报查询</th>
</tr>
<tr>
<th>
<select id="cityCode" name="cityCode" onchange="javascript:getWeather()">
<c:forEach items="${requestScope.citys}" var="city">
<option value="${city.key}">${city.value}</option>
</c:forEach>
</select>
</th>
</tr>
</table>
<div id="weatherResult" align="left"></div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -