thinkphp使用js实现点击加载更多后, 底部无刷新加载出新的数据并显示在该页
来源:互联网 发布:2016流行语言网络语言 编辑:程序博客网 时间:2024/06/09 12:48
thinkphp使用js实现点击加载更多后, 底部无刷新加载出新的数据并显示在该页
一.模板需要文件:
1、<script language="javascript" src="/js/home/home_v2.js"></script>
2、<script type="text/javascript" src="/js/home/jquery.min.js"></script>
3、<div id="mainbox"></div>
4、<dl class="index_list"></dl>
5、<dt><a href="__APP__/Common/p_list_more/id/<{$id}>/p/1" data-box=".index_list" class="js_more_list"><button>点击查看更多...</button></a></dt>
说明:1和2是实现无刷新加载更多需要的js文件,3和4是显示数据模板中需要有的div便签,5是加载更多按钮,data-box=".index_list"定义加载出来的数据显示在哪里, class="js_more_list"用于响应加载更多js
二.模板需要文件:Common文件的p_list_more方法代码如下:
/** * 加载更多 */ public function p_list_more(){ $p=intval($_GET['p']); $id=intval($_GET['id']); if(!$p) $p=1; $start=$p*10; //**查询文章评论内容 $comments = D('Comment a')->field('a.*') ->where("a.newsid = $id and a.comment_show=1 and a.comment_delete=0") ->order('a.comment_time desc') ->limit($start, 10) ->select(); $this->assign("p", $p+1); $this->assign("id", $id); $this->assign("comments", $comments); $this->display(); }
三.js文件下载
home_v2.js
jquery.min.js
http://pan.baidu.com/s/1nuyIcJJ
0 1
- thinkphp使用js实现点击加载更多后, 底部无刷新加载出新的数据并显示在该页
- 使用jquery.more.js来实现点击底部更多后, 底部加载出新的数据
- [jquery 经过检验成功]使用jquery.more.js来实现点击底部更多后, 底部加载出新的数据
- 使用jquery来实现点击底部更多后, 底部加载出新的数据
- thinkphp+ajax 实现点击加载更多数据
- thinkphp+ajax 移动端实现滚动到底部加载数据(无刷新动态加载数据技术的应用)
- 列表页点击加载更多,无刷新加载更多文章的方法(yii)
- 动态的把数据显示在table中,点击某一行的删除按钮实现该行的删除(通过ajax实现页面的无刷新加载)
- 动态的把数据显示在table中,点击某一行的删除按钮实现该行的删除(通过ajax实现页面的无刷新加载)
- Android下拉刷新库,利用viewdraghelper实现,集成了下拉刷新,底部加载更多,数据初始加载显示loading等功能
- 详解iPhone Tableview分批显示数据 实现点击加载更多
- ListView的下拉刷新,点击加载更多
- 点击加载更多(适用于listview在scrollview单行显示修正后多数据加载慢的情况)
- SwipeRefreshLayout配合RecyclerView实现下拉刷新和上拉加载更多以及没有数据的显示
- SwipeRefreshLayout配合RecyclerView实现下拉刷新和上拉加载更多以及没有数据的显示
- pulltorefresh上拉加载,没有更多数据的时候显示“加载完成”,不回调刷新接口的实现
- 一步一步实现ListView加载网络数据,下滑底部加载,顶部下拉刷新。并配有双缓存
- thinkphp滚屏加载--无刷新动态加载数据技术的应用
- The 7th Zhejiang Provincial Collegiate Programming Contest->Problem B:B - Somali Pirates
- php的str_replace函数
- C++数据结构 简单栈 (一贯作风::懒)
- ffmpeg .avi视频转码
- memcpy和memmove() 实现和区别
- thinkphp使用js实现点击加载更多后, 底部无刷新加载出新的数据并显示在该页
- LICECAP Gif屏幕录制软件
- The 7th Zhejiang Provincial Collegiate Programming Contest->Problem G:G - Wu Xing
- AMD&CommonJS入门学习
- leetcode:Kth Smallest Element in a B
- Android--Dialog对话框
- 得不到数据库中的数据
- I/O复用的高级应用三:同时处理TCP和UDP服务
- 《我编程,我快乐(1~2章)》读书笔记