jquery的获取天气为什么不能进回调呢?
function getweather() {
var weatherurl = "http://www.weather.com.cn/data/cityinfo/101010100.html";
var params = new Object();
$.get(weatherurl,
params,
function (data, textStatus) {
alert(obj);
var obj = new Object();
if (typeof (data) == "object") {
obj = data;
}
else {
obj = eval("(" + data + ")");
}
});}
function getweather() {
var weatherurl = "http://www.weather.com.cn/data/cityinfo/101010100.html";
var params = new Object();
$.get(weatherurl,
params,
function (data, textStatus) {
alert(obj);
var obj = new Object();
if (typeof (data) == "object") {
obj = data;
}
else {
obj = eval("(" + data + ")");
}
});}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货