Home > php教程 > php手册 > PHP+jquery.more.js实现底部加载更多

PHP+jquery.more.js实现底部加载更多

WBOY
Release: 2016-06-07 11:37:16
Original
2603 people have browsed it

jquery.more.js操作原理:点击加载更多时候,触发事件,发送ajax请求到php ,php 将数据发送回ajax 回调函数里面,然后用js 追加到你页面的后面就可以了
PHP+jquery.more.js实现底部加载更多
jquery.more.js使用方法:
引入文件<script></script>  <br> <script></script>调用加载更多数据插件:jquery.more.js$(function(){  <br>     $('#more').more({'address': 'data.php'})  <br> });PHP处理require_once('connect.php'); <br>  <br> $last = $_POST['last']; <br> $amount = $_POST['amount']; <br>  <br> $query = mysql_query("select * from article order by id desc limit $last,$amount"); <br> while ($row = mysql_fetch_array($query)) { <br>     $sayList[] = array( <br>         'title' => "<a>".$row['title']."</a>", <br>         'author' => $row['id'], <br>         'date' => date('m-d H:i', $row['addtime']) <br>     ); <br> } <br> echo json_encode($sayList);jquery.more.js中文API和加载更多演示:http://www.sucaihuo.com/js/380.html

附件 PHP+Ajax点击加载更多内容.zip ( 10.06 KB 下载:192 次 )

AD:真正免费,域名+虚机+企业邮箱=0元

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template