lijiong520 发表于 2008-4-12 11:04

求下列两款格式天气预报的代码(有参考站~)

1 .  参考站:http://main.mapbar.com/
2.   参考站http://www.nypsyl.cn/

上面的能根据IP显示更好, 不能的话,只要显示 ”河南南阳”的

谢谢哦~~

lmhllr 发表于 2008-4-13 16:42

求代码的

kevintang 发表于 2008-4-14 09:47

很早以前做的

这是我截取QQ上的天气预报!是用WINFROM做的

kevintang 发表于 2008-4-14 09:49

数据库找不到了!我是保存在数据库中的!你们看插入的字段的表名吧!我在APP.CONFIG中配置的数据源

mysky109 发表于 2008-4-22 16:17

不能直接用script获得吗,用类很麻烦的

babyzft 发表于 2008-4-26 11:34

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">&nbsp;'+allWeather[1]+'&nbsp;&nbsp;&nbsp;'+allWeather[2]+'&nbsp;&nbsp;&nbsp;'+allWeather[3]+'&nbsp;&nbsp;&nbsp;'+allWeather[4]+'&nbsp;&nbsp;&nbsp;'+allWeather[5];
                        }catch(e){alert(e.message());}

                }


这是你的第一个站的JS调用的方法 你自己调用就好了
调用之后在
<div class="temp4weather"  id="showWeather"></div>
这里面显示

页: [1]

编程论坛