去掉就好了,有大神知道为什么吗?另外分页按键放在那里好些,我放到form表单下,就开始显示,点一下后就没有了" /> 去掉就好了,有大神知道为什么吗?另外分页按键放在那里好些,我放到form表单下,就开始显示,点一下后就没有了 - 秒客网" />

问题:做EsayUI分页报错 $(...).pagination is not a function之后我把去掉就好了,有大神知道为什么吗?另外分页按键放在那里好些,我放到form表单下,就开始显示,点一下后就没有了

时间:2021-08-26 22:02:11

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

<head>
  <meta charset="utf-8" />
  <title>后台管理系统</title>
  <meta name="author" content="DeathGhost" />
  <link rel="stylesheet" type="text/css" href="css/style.css">
  <link rel="stylesheet" type="text/css" href="easyui/themes/default/easyui.css">
  <link rel="stylesheet" type="text/css" href="easyui/themes/icon.css">
  <script src="js/jquery.js"></script>
  <script src="easyui/jquery.easyui.min.js"></script>
  <script src="easyui/easyui-lang-zh_CN.js"></script>
  <script src="js/jquery.mCustomScrollbar.concat.min.js"></script>

</head><body>

<header>

<!--引入-->
  <jsp:include page="top.jsp"/>

 <jsp:include page="left.jsp"/>
</header>
 

<section class="rt_wrap content mCustomScrollbar">
  <div class="rt_content">
    <div class="page_title">
      <h2 class="fl">登录列表</h2>
    </div>
<!--分页按键-->
<div id="pp"></div>

<form action="" name="myform" method="post">
  <table class="table" id="show">
    <tr>
      <th>用户名字</th>
      <th>真实名字</th>
      <th>登录时间</th>
      <th>登录IP</th>
      <th>操作</th>
    </tr>
  </table>
</form>
</div>
</section>
</body>
<script type="text/javascript">
  $(function(){
    $.ajax({
      type:"get",
      url:"LoginLogServlet.do",
      async:true,
      data:{"pn":1,"ps":5},
      dataType:"json",
      success:function(data){
      showTable(data);
        }
      });
    $.ajax({
      type:"get",
      url:"countNum.do",
      async:true,
      dataType:"json",
      success:function(data){
      $("#pp").pagination({
      total:data[0],
      pageSize:data[1],
      pageList: [1,2,5,10],
      buttons: [{
        iconCls:'icon-add',
        handler:function(){alert('add')}
        },'-',{
        iconCls:'icon-save',
        handler:function(){alert('save')}
       }],
     layout:['list','first','prev','links','next','last'],
     onSelectPage:function(pageNumber, pageSize){
      $.ajax({
    type:"get",
    url:"LoginLogServlet.do",
    async:true,
    data:{"pn":pageNumber,"ps":pageSize},
    dataType:"json",
    success:function(data){
      showTable(data);
      }
    });
  }
});
}
});
});
function showTable(json){
  $("tr:gt(0)").remove();
  $.each(json,function(index,e){
  var tr=$("<tr/>");
  $("<td>").html(e.account.accountName).appendTo(tr);
  $("<td>").html(e.account.accountRealName).appendTo(tr);
  $("<td>").html(e.loginLog.loginTime).appendTo(tr);
  $("<td>").html(e.loginLog.loginIp).appendTo(tr);
  $("<td>").html("<a href='#' onclick='update("+"\""+e.loginLog.loginLogId+")'>修改</a>").appendTo(tr);
  $("#show").append(tr);
  });
}
</script>
</html>