通过xmlhttp的方式,利用qq天气预报,获得某一特定地方的天气预报

[入库:2005年8月18日] [更新:2007年3月25日]

本文简介:选择自 enjsky 的 blog

<html>
<head>
<title> new document </title>
<meta name="generator" content="editplus">
<meta name="author" content="">
<meta name="keywords" content="">
<meta name="description" content="">
</head>

<body>
<div align="center" id="now_time">now_time
</div>
<div id="wuhan_weather"></div>
<script language="javascript">
var x = new array("星期日", "星期一", "星期二");
var x = x.concat("星期三","星期四", "星期五");
var x = x.concat("星期六");
var now_time = new date();
document.all("now_time").innertext=now_time.getfullyear()+'年'+(now_time.getmonth()+1)+'月'+now_time.getdate()+'日\n'+x[now_time.getday()];

 var xmlhttp = new activexobject("msxml2.xmlhttp");
        xmlhttp.open("post","http://appnews.qq.com/cgi-bin/news_qq_search?city=",false);
        xmlhttp.send();
        var xmlreturn=new activexobject("msxml2.domdocument");
            xmlreturn=xmlhttp.responsetext;
document.all("wuhan_weather").innerhtml="<table width=180 style='font-size:12px;'>"+xmlreturn.substring(7863,8811)+"</table>"

</script>
</body>
</html>

本文关键:通过xmlhttp的方式,利用qq天气预报,获得某一特定地方的天气预报
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top