`
lzl836
  • 浏览: 13423 次
  • 性别: Icon_minigender_1
  • 来自: 大连
社区版块
存档分类
最新评论
阅读更多

练习~

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>weather</title>
<script type="text/javascript" src="jquery.js"></script>
<script>
$(document).ready(function(){
	$.ajax({
		url: "http://m.weather.com.cn/data/101070201.html",
		cache: true,
		success: function(js){
			
			//document.write(js.weatherinfo.city);
			var str = "<B>" + js.weatherinfo.city + "<B/><br/>"
			str +=js.weatherinfo.date_y + " " + js.weatherinfo.week + "<br/>"
			str += "农历:" + js.weatherinfo.date + "<br/>"
			str += "气温:" + js.weatherinfo.temp1 + "<br/>"
			str += "风力:" + js.weatherinfo.wind1 + "<br/>"
			str += "建议:" + js.weatherinfo.index_d + "<br/>"
			
			$("div").html(str)
		},
		dataType : "json"
	});
})
</script>
</head>

<body bgcolor="#004e98" >
<div id="results" style="color:white;">
</div>
</body>
</html>
 
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics