求下列两款格式天气预报的代码(有参考站~)
1 . 参考站:http://main.mapbar.com/2. 参考站http://www.nypsyl.cn/
上面的能根据IP显示更好, 不能的话,只要显示 ”河南南阳”的
谢谢哦~~
很早以前做的
这是我截取QQ上的天气预报!是用WINFROM做的 数据库找不到了!我是保存在数据库中的!你们看插入的字段的表名吧!我在APP.CONFIG中配置的数据源 不能直接用script获得吗,用类很麻烦的 function setWeather( city ){;try{
XMLHttp.sendReq('GET', '/weathers.jsp?city='+encodeURI(city), '', getWeather);
}catch(e){alert(e.message());}
}
function getWeather(obj) {
try{
var strWeather = obj.responseText;
var allWeather = strWeather.split("^");
document.getElementById("showWeather").innerHTML = '<img src="/images/wimage/'+allWeather[0]+'" width="15" height="15"> '+allWeather[1]+' '+allWeather[2]+' '+allWeather[3]+' '+allWeather[4]+' '+allWeather[5];
}catch(e){alert(e.message());}
}
这是你的第一个站的JS调用的方法 你自己调用就好了
调用之后在
<div class="temp4weather" id="showWeather"></div>
这里面显示
页:
[1]
