求注 前台接收了后台的json 为什么总是循环不到table中
9 回复
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
<title>baoxiao.html</title>
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="this is my page">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="./css/baixoiaozt.css">
<script type="text/javascript" src="./js/jquery-2.1.4.js"></script>
<script type="text/javascript" src="./js/jquery-1.8.3.min.js"></script>
</head>
<body>
<div id="d" >报销列表</div>
<div id="im"><img src="./image/zkh.png" height="40px" width="40px" ></div>
<div id="im1"><a href="baoxiaoXZ.html" target="_self"><img src="./image/bx_j.png" height="40px" width="40px" ></a></div>
<div class="div1">
<form action="" method="post">
<table class="tb" >
<tr>
<td><span style="font-size: 26px;margin-left: 20%" >时间</span></td>
<td><input type="date" name="startDat" id="i"></td>
<td><span style="font-size: 26px;margin-left: 20%" >状态</span></td>
<td><select id="a" name=AuditStatus style="width:200px ;height:40px; margin-right: 50%; font-size: 26px;">
<option value="0">未审核</option>
<option value="1">已审核</option>
</select></td>
<td><button type="submit" style=" border-radius: 5px; background:#0099FF; color: #FFFFFF; border: 1px #555 solid;height:30px;width: 80px; margin-right: 100%" onclick="submi()">查询</button></td>
</tr>
</table>
</form>
</div>
<div>
<table class="table" >
<tr class="tr">
<td rowspan="2" style="border-top:1px solid #BBB; border-bottom: 1px solid #BBB;"><img src="./image/small/bx_cl.png" style="margin-left: 40%; height:50px; width:70px;margin-top: 5%;"></td>
<td style="border-top:1px solid #BBB;font-family: 微软雅黑; font-size: 33px;margin-top: 10px;">${Json.bxPk}</td>
<td style="border-top:1px solid #BBB;"><button style="font-size: 20px;height: 30px;width: 120px;">日常报销</button></td>
<td colspan="3" style="border-top:1px solid #BBB;"><span style="margin-left: 80%;font-size: 30px;">${Amount}</span></td>
</tr >
<tr class="tr">
<td style="border-bottom: 1px solid #BBB; font-family: '微软雅黑'; font-size: 30px; margin-bottom: 10px;">${fyCate}</td>
<td colspan="4" style="border-bottom: 1px solid #BBB;"><span style="margin-left: 85%;font-size: 20px;"> ${fyday}</span></td>
</tr >
</table>
</div>
<table id="table1">
<thead>
<tr>
<th width="4%">姓名</th>
<th width="12%">密码</th>
<th width="10%">阿斯顿</th>
<th width="8%">时间A</th>
<th width="8%">时间B</th>
</tr>
</thead>
<tbody id="html_" >
</tbody>
</table>
<script type="text/javascript">
function submi(){
var startDat=$("#i").val();
var AuditStatus=$("#a").val();
$.ajax({
type: "post",
url: "ard/n/common/reimburse/queryReimburse",
data: {"startDat":startDat,"auditStatus":AuditStatus},
success: function(data){
//获取到json 是String 类型
var a =data.json;
alert(a);
//转换成标准的Json格式
var c = JSON.parse(a)
var html="";
for( var i = 0; i < c.length; i++){
alert(c[i].fyday+11111111);
console.log(c[i].fyday);
html += "<tr>" + "<td>"
+ c[i].fyday+ "</td>" +
"<td>"+ c[i].fyday + "</td>"+
"<td>"+ c[i].fyday+ "</td>" +
"<td>"+ c[i].fyday + "</td>"+
"<td>" + c[i].fyday+ "</td>" +
"<td>" + c[i].fyday +"</td>"+
"</tr>";
}
alert(html);
$("#html_").html(html);
}
});
}
</script>
</body>
</html>
添加回复
请先登陆