其他分享
首页 > 其他分享> > 问题:做EsayUI分页报错 $(...).pagination is not a function之后我把<jsp:include page="top.jsp"/>去

问题:做EsayUI分页报错 $(...).pagination is not a function之后我把<jsp:include page="top.jsp"/>去

作者:互联网

<%@ 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>

标签:function,分页,tr,appendTo,json,html,报错,data
来源: https://www.cnblogs.com/renxinghua/p/11870534.html