AJAX分页与codeigniter和jQuery [英] AJAX pagination with codeigniter and jquery

查看:158
本文介绍了AJAX分页与codeigniter和jQuery的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以帮助我使用JQuery一个简单的AJAX分页在codeigniter?从数据库queryed的分页列表。 我在网上搜索,但所有的exemples是非常复杂的... 谢谢你提前和对不起我的英文不好...

Can someone help me with a simple AJAX pagination in Codeigniter using JQuery? With the paginated list queryed from the database. I searched the web but all the exemples are very complex... Thank you in advance and sorry for my bad english...

推荐答案

只需使用codeigniter分页简单,使用下列通过jquery的$ C $下分页:

just use codeigniter pagination simple and use following code for pagination through jquery:

<script>
$(function(){
   $("#pagination-div-id a").click(function(){
   $.ajax({
   type: "POST",
   url: $(this).attr("href"),
   data:"q=<?php echo $searchString; ?>",
   success: function(res){
      $("#containerid").html(res);
   }
   });
   return false;
   });
});
</script>

下面分页的div id是分页容器containerid的ID是简单的容器的id,你显示结果。

Here pagination div id is the id of pagination container and containerid is simple the container id where you showing the result.

这篇关于AJAX分页与codeigniter和jQuery的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆