>>04:40:54:变量未定义(VAR_NOT_DEFINED):obj 位于114行 资源:productlist.html
111| <button class="btn" id="start">首页</button>
112| <button class="btn" id="startPage">上一页</button>
113|
114| <a>${obj.pager.pageNumber}</a>
115|
116| <button class="btn" id="endPage">上一页</button>
117| <button class="btn" id="end">尾页</button>
@At("/product/list")
@POST
public Object query(@Param("..")ProductBean productBean, @Param("..")Pager pager) {
return productService.query(productBean,pager);
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<script type="text/javascript" src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.js"></script>
<script type="text/javascript">
$(function () {
f();
$("#user_query_btn").click(function () {
alert("1111111111111")
f();
})
})
function f() {
var data = $("#user_query_form").serialize();
$.ajax({
url: "/product/list/",
type: "post",
data: data,
dataType: "json",
success: function (data) {
var list_html = "<tr> <td>"
+ "产品编号</td>"
+ "</td> <td>"
+ "产品名称</td>"
+ "<td>"
+ "产品价格</td>"
+ "<td>"
+ "产品规格</td>"
+ "<td>"
+ "产品图片</td>"
+ "<td>"
+ "产品排序</td>"
+ "<td>"
+ "产品状态</td>"
+ "<td>"
+ "上架时间</td>"
+ "</tr>";
+"<td>"
+ "操作</td>"
+ "</tr>";
console.log(data.list);
for (var i = 0; i < data.list.length; i++) {
var product = data.list[i];
console.log(product);
var tmp = "<tr> <td>"
+ product.product_barcode
+ "</td>"
+ "</td> <td>"
+ product.product_name
+ "</td>"
+ "<td>"
+ product.product_price
+ "</td>"
+ "<td>"
+ product.product_standard
+ "</td>"
+ "<td>"
+ product.product_image
+ "</td>"
+ "<td>"
+ product.product_sort
+ "</td>"
+ "<td>"
+ product.product_status
+ "</td>"
+ "<td>"
+ product.create_time
+ "</td>"
+ "</tr>";
"<td>修改"
+"<a href='/product/update?product_id="+product.product_id+"'></a>"
+ "</td>"
+ "</tr>";
list_html += tmp;
}
$("#product_list").html(list_html);
}
});
}
</script>
</head>
<body>
<div>
<form action="#" id="user_query_form">
产品名称<input type="text" name="product_name">
产品排序<input type="text" name="product_sort">
创建时间<input type="text" name="create_time">
<input type="hidden" name="pageNumber" value="1">
<input type="hidden" name="pageSize" value="10">
<button id="user_query_btn">查询</button>
<div>
<button class="btn" id="start">首页</button>
<button class="btn" id="startPage">上一页</button>
<a>${obj.pager.pageNumber}</a>
<button class="btn" id="endPage">上一页</button>
<button class="btn" id="end">尾页</button>
</div>
</form>
<table id="product_list">
</table>
</div>
</body>
</html>