datalist.reverse();//翻转的核心函数reverse()
for (var i = 0; i < datalist.length; i++) {
var record = "<div class='mesbox unread recordlist' name=" + datalist[i].credit_code + ">";
record += "<h2 name=" + datalist[i].source + ">" + datalist[i].enterprise_name + "</h2>";
record += "<p>" + datalist[i].reqtime + "</p>";
record += "<p class='mes_view mui-navigate-right'>查看详情</p>";
record += "</div>";
$("#recordlist").append(record);
}
JS 逆向循环,JS 反向遍历
最新推荐文章于 2023-09-17 21:14:53 发布