分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > 运营维护

JS——天气预报表格

发布时间:2023-09-06 01:32责任编辑:彭小芳关键词:暂无标签

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<table border="1"cellpadding="5" width="100%">
<tr><th>日期</th><th>日出</th><th>高温</th><th>低温</th><th>日落</th><th>空气质量</th><th>风向</th><th>风力</th><th>类型</th><th>小提示</th></tr>
<script type="text/javascript">

var air=[{
"date":"18日星期一",
"sunrise":"07:47",
"high":"高温 8.0℃",
"low":"低温 5.0℃",
"sunset":"18:23",
"aqi":65.0,
"fx":"无持续风向",
"fl":"<3级",
"type":"阴",
"notice":"灰蒙蒙的天空就像模糊了的眼睛"
},
{
"date":"19日星期二",
"sunrise":"07:47",
"high":"高温 9.0℃",
"low":"低温 2.0℃",
"sunset":"18:23",
"aqi":69.0,
"fx":"无持续风向",
"fl":"<3级",
"type":"多云",
"notice":"今日多云,骑上单车去看看世界吧",
},
{
"date":"20日星期三",
"sunrise":"07:48",
"high":"高温 11.0℃",
"low":"低温 1.0℃",
"sunset":"18:24",
"aqi":57.0,
"fx":"无持续风向",
"fl":"<3级",
"type":"晴",
"notice":"lovely sunshine,尽情享受阳光的温暖吧",
},
{
"date":"21日星期四",
"sunrise":"07:49",
"high":"高温 14.0℃",
"low":"低温 1.0℃",
"sunset":"18:24",
"aqi":58.0,
"fx":"无持续风向",
"fl":"<3级",
"type":"晴",
"notice":"天气干燥,请适当增加室内湿度",
},
{
"date":"22日星期五",
"sunrise":"07:49",
"high":"高温 14.0℃",
"low":"低温 3.0℃",
"sunset":"18:25",
"aqi":51.0,
"fx":"无持续风向",
"fl":"<3级",
"type":"晴",
"notice":"晴空万里,去沐浴阳光吧",
},
{"date":"23日星期六",
"sunrise":"07:50",
"high":"高温 16.0℃",
"low":"低温 4.0℃",
"sunset":"18:25",
"aqi":56.0,
"fx":"无持续风向",
"fl":"<3级",
"type":"多云",
"notice":"悠悠的云里有淡淡的诗",
}
];
for(var i=0;i<air.length;i++){
document.write("<tr>");
for(var j in air[i]){
document.write("<td>"+air[i][j]+"</td>")
console.log(air[i][j])
}
document.write("</tr>")
}
</script>
</table>
</body>
</html>

JS——天气预报表格

原文地址:https://www.cnblogs.com/yan-linxi/p/8125910.html

知识推荐

我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved