ajax从后台取得值怎么在jsp页面table中通过遍历展示出来

如题所述

第1个回答  2017-10-09
给你一个实例吧。
在ajax中遍历:
$.each(result.jsonList, function(index, element) {
var div = $("<div class='checkbox-dayPlan' onclick='chgDayPlanCheckStatus(this)'><input type='checkbox' name='arrReordIds' class='chkbox arrReordIds' value='" + element.recordId + "'/><label></label><li class='color' style='margin:16px;'> "+element.name+"</li></div>");/*编辑页面的样式*/
$("#schedule").append(div);/*插入schedule中*/
});
插入table中:
<table class="tbl tbl_form" id="cmnTblList">
<div class="panel_body" id="schedule" style="height: 670px; overflow: auto;">
<!--插入的地方-->
</div>
</table>本回答被提问者采纳
相似回答