分页功能无法显示,一直报错

提问 未结 4 68
btchong35
btchong35 3天前
悬赏:20飞吻
版本:layuiAdmin 浏览器:
我按照官网的分页功能写的,但就是一直不显示,并报错,报错内容和代码如下,各位大神帮我看一下吧


<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html class="iframe-h">

<head>
<meta charset="UTF-8">
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<title>网站后台管理模版</title>
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/static/admin/layui/css/layui.css" />
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/static/admin/css/admin.css" />
<script src="${pageContext.request.contextPath }/static/admin/layui/lay/modules/jquery.js" type="text/javascript" charset="utf-8"></script>
<script src="${pageContext.request.contextPath }/static/admin/layui/layui.js" type="text/javascript" charset="utf-8"></script>
<script src="${pageContext.request.contextPath }/static/admin/js/common.js" type="text/javascript" charset="utf-8"></script>

</head>

<body>
<div class="wrap-container clearfix">
<div class="column-content-detail">
<form class="layui-form" action=" ../cate/list">
<div class="layui-form-item">
<div class="layui-inline tool-btn">
<button class="layui-btn layui-btn-small layui-btn-normal addBtn" data-url="article-add.html"><i class="layui-icon"></i></button>
<button class="layui-btn layui-btn-small layui-btn-danger delBtn" data-url="article-add.html"><i class="layui-icon"></i></button>
<button class="layui-btn layui-btn-small layui-btn-warm listOrderBtn hidden-xs" data-url="article-add.html"><i class="iconfont"></i></button>
</div>
<div class="layui-inline">
<input type="text" name="catename" placeholder="请输入关键词" autocomplete="off" class="layui-input">
</div>
<button class="layui-btn layui-btn-normal" lay-submit="search">搜索</button>
</div>
</form>
<div class="layui-form" id="table-list">
<table class="layui-table" lay-even lay-skin="nob">
<colgroup>
<col width="50">
<col class="hidden-xs" width="50">
<col width="180">
<col width="80">
<col width="150">
</colgroup>
<thead>
<tr>
<th><input type="checkbox" name="" lay-skin="primary" lay-filter="allChoose"></th>
<th class="hidden-xs">ID</th>
<th>名称</th>
<th>描述</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<c:forEach var="c" items="${info.list }">
<tr>
<td><input type="checkbox" name="" lay-skin="primary" data-id="${c.cateid }"></td>
<td class="hidden-xs">${c.cateid }</td>
<td>${c.catename }</td>
<td>${c.description }</td>
<td>
<div class="layui-inline">
<button class="layui-btn layui-btn-small layui-btn-normal go-btn" data-id="1" data-url="article-detail.html"><i class="layui-icon"></i></button>
<button class="layui-btn layui-btn-small layui-btn-danger del-btn" data-id="1" data-url="article-detail.html"><i class="layui-icon"></i></button>
</div>
</td>
</tr>
</c:forEach>

</tbody>
</table>
<!-- <div class="page-wrap">
<ul class="pagination">
<li class="disabled"><span>«</span></li>
<li class="active"><span>1</span></li>
<li>
<a href="#">2</a>
</li>
<li>
<a href="#">»</a>
</li>
</ul>
</div> -->
<div id="page-id" >
</div>
<script type="text/javascript">
layui.use('laypage', function(){
var laypage = layui.laypage;

//执行一个laypage实例
laypage.render({
elem: 'page-id' //注意,这里的 test1 是 ID,不用加 # 号
,count: 100 //数据总数,从服务端得到
,pages:10
,limit:10
,groups:4
,curr:1
,jump:function(obj,first){
console.log(obj.curr);
if(!first){
window.location.href="${pageContext.request.contextPath }/cate/list?now="+obj.curr;
}
}
});
});
</script>
</div>
</div>
</div>

</body>

</html>
回帖
  • layui.js 没有引入
    0 回复
  • 我引入了啊,路径完全没错啊。
    0 回复
  • 我发现如果先引jquery.js,后面再引layui.js,就会出现这个问题,不知道是为什么。
    0 回复
  • 先引layui.js,再引jquery.js
    0 回复