在线直播系统源码,数组遍历提取,订单效果
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
</body>
<script>
var a = {
"imgComments": {
"imgList": [
{
"imageId": 698391890,
"content": "操作简单方便,使用舒适感强,声音小?",
"creationTime": "2018-11-01 23:51:40",
"nickname": "j***9",
"productColor": "5050CC",
"userLevelName": "银牌会员",
"userClientShow": "来自京东Android客户端",
},
{
"imageId": 698391889,
"content": "还不错,老婆很喜欢",
"creationTime": "2018-10-05 23:51:40",
"nickname": "h***2",
"productColor": "C550C0",
"userLevelName": "钻石会员",
"userClientShow": "来自京东iPhone客户端",
}
]
}
}
document.write("<ul>");
var b = a.imgComments.imgList;
for (var i = 0; i < b.length; i++) {
var c = b[i];
document.write("<li>订单编号" +c.imageId+"用户昵称:"+c.nickname+",评价内容:"+c.content+"评价时间:"+c.creationTime+","+c.userLevelName+",来源:"+c.userClientShow);
document.write("</li>");
}
document.write("</ul>");
// 把上述json对象遍历成如效果图。
</script>
</html>
以上就是在线直播系统源码,数组遍历提取,订单效果, 更多内容欢迎关注之后的文章
标签:遍历,write,直播,var,document,源码 From: https://www.cnblogs.com/yunbaomengnan/p/16892257.html