一、使用smarty+ajax+php实现无刷新分页效果
效果图

![]()
1 <!DOCTYPE html>
2 <html lang="en">
3 <head>
4 <meta charset="UTF-8">
5 <title>ajax分页</title>
6 <style>
7 table{
8 border-collapse: collapse;
9 width:700px;
10 height:300px;
11 margin:0 auto;
12 text-align: center;
13 }
14 tr,td{
15 border:1px solid #ccc;
16 }
17 a{
18 margin-left:10px;
19 text-decoration: none;
20 }
21 </style>
22 <script src="../js/jquery-1.12.4.min.js"></script>
23 <script src="newpublic.js"></script>
24 <script>
25 $(function(){
26 //页面载入后查看第一页的数据
27 display(1);
28 //取得第page页数据
29 function display(page){
30 //page:页码
31 $.get("page.php","page="+page,function(result){
32 $("#content").html(result);
33 })
34 }
35 })
36 </script>
37 </head>
38 <body>
39 <div id="content"></div>
40 </body>
41 </html>
分页html代码