var xmlHttp = createXML();
var xmlHttpCity = createXML();
function getWeather(City)
{
xmlHttp.onreadystatechange = returnWeather;
xmlHttp.open("GET","Weather.asp?City=" + City,true);
xmlHttp.setRequestHeader("If-Modified-Since","0");
xmlHttp.send(null);
}
function returnWeather()
{
if(xmlHttp.readyState == 4)
{
if(xmlHttp.status == 200)
{
setCv("Weather",bytes2BSTR(xmlHttp.responseBody));
}
else
{
setCv("Weather","Server Error");
}
}
else
{
setCv("Weather","正在获取天气信息,请稍后...");
}
}
function getCity()
{
xmlHttpCity.onreadystatechange = returnCity;
xmlHttpCity.open("GET","Ip.asp",true);
xmlHttpCity.setRequestHeader("If-Modified-Since","0");
xmlHttpCity.send(null);
}
function returnCity()
{
if(xmlHttpCity.readyState == 4)
{
if(xmlHttpCity.status == 200)
{
getWeather(bytes2BSTR(xmlHttpCity.responseBody));
}
else
{
setCv("Weather","Server Error");
}
}
else
{
setCv("Weather","正在获取地区信息,请稍后...");
}
}