H5获取当地天气预报
$.getScript('http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js', function(_result) {
if (remote_ip_info.ret == '1') {
$.ajax({
type: "GET",
url: "http://wthrcdn.etouch.cn/weather_mini?city="+remote_ip_info.city,
data: "",
success: function(msg){
var res = eval('('+msg+')');
//alert(msg);
if(res.status==1000){
//请求成功
$('#currentCity').html(res.data.city);
$('#wendu').html(res.data.wendu);
$('#weather').html(res.data.forecast[0].type);
}
}
});
}
});