📄 weather.aspx
字号:
<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>天气查询</title>
<script type="text/javascript" src="xmlhttp.js"></script>
<script type="text/javascript">
function getWeather()//查询天气
{
if($("city").value=="")//未填入城市名称
{
alert("请输入城市名!");
return
}
var post="city="+$("city").value;//post的数据
Request.sendPOST("weather.ashx",post,revDetail,null,null);//发送请求
}
function revDetail(req,data)//接收到服务器返回信息后的调用函数
{
var text=req.responseText;//接收返回的文本
if(!text || text=="")//没有数据
{
alert("没有你要查询的数据!");
return;
}
$("content").innerHTML=text;//显示返回的内容
}
</script>
</head>
<body>
<div>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="80" colspan="3" align="center" valign="middle">
<br />
<h2>
天气预报查询</h2>
<span>
<br />
请输入城市:</span>
<input type="text" class="bd2" id="city" />
<input type="button" onclick="getWeather()" class="bd" value="查询" />
<center style="color: Red; font-size: 20px; display: none" id="loadingflag">
正在查询天气状况.......</center>
<div id="content" class="content2">
</div>
</td>
</tr>
</table>
</div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -