您好,欢迎访问一九零五行业门户网

html中嵌入天气预报_html/css_WEB-ITnose

先看效果:
html代码:
js代码:
function findweather() {
var cityurl = 'http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js';
$.getscript(cityurl, function(script, textstatus, jqxhr) {
var citytq = remote_ip_info.city ;// 获取城市
var url = http://php.weather.sina.com.cn/iframe/index/w_cl.php?code=js&city= + citytq + &day=0&dfc=3;
$.ajax({
url : url,
datatype : script,
scriptcharset : gbk,
success : function(data) {
var _w = window.swther.w[citytq][0];
var _f= _w.f1+_0.png;
if(new date().gethours() > 17){
_f= _w.f2+_1.png;
}
var img = ;
var day = (new date().getmonth()+1)+月+(new date().getdate())+日;
var tq =
+++day++_w.s1+
++_w.t1 + ℃~ + _w.t2 + ℃+
+
+img;
$('#weather').html(tq);
}
});
});
}
findweather();
其它类似信息

推荐信息