HTML5 天气预报 互动版

通过城市标识(woeid),获取天气信息

前面我们个、通过getWoeid()方法,获取到城市的标识,现在用此标识通过getWeatherInfo()方法,获取此城市的具体天气情况。

function getWeatherInfo(woeid) {
    var weatherYQL = 'select * from weather.forecast where woeid=' + woeid + ' and u = "' + unit + '" &format=json';
    var jsonURL = baseYahooURL + weatherYQL
    $.getJSON(jsonURL, weaterInfoDownloaded);
}