$.getJSON("http://query.yahooapis.com/v1/public/yql", {q: "select * from json where url=\"http://www.weather.com.cn/data/cityinfo/101190501.html\"",format: "json"}, function(data) {
var $content = $("#content");
if (data.query.results) {
var tq = "暂无天气信息";
var weatherinfo = data.query.results.weatherinfo;
//weatherinfo就是获取的数据
}
})
var $content = $("#content");
if (data.query.results) {
var tq = "暂无天气信息";
var weatherinfo = data.query.results.weatherinfo;
//weatherinfo就是获取的数据
}
})