du16178 2016-12-30 18:19
浏览 50

查询jquery分页中的字符串ajax

The problem is the following (Sorry for my english if it's not correct):

I am using a library called "Jquery_pagination" and the pagination works at 100% without any inconvenience. The problem is that when the user clicks on some part of the pagination, for example page number 2, it works correctly but when he clicks the return button of his browser he returns to the initial page and not to the previous page of the page pagination ... Is there any way to make this work? I was thinking of adding a GET parameter in the URL as

            http://localhost/mycontroller/jobs-in-brazil?page=1

but I do not know how to do it either. I need it to be purely ajax.

I'm using Codeigniter.

Thanks in advance.

  • 写回答

1条回答 默认 最新

  • dtvp3625 2016-12-30 18:28
    关注

    Just use the codeigniter default pagination plugin and try this :

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

    Hope this helps !!!

    评论

报告相同问题?

悬赏问题

  • ¥15 chaquopy python 安卓
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 有没有帮写代码做实验仿真的
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥30 vmware exsi重置后登不上
  • ¥15 易盾点选的cb参数怎么解啊
  • ¥15 MATLAB运行显示错误,如何解决?
  • ¥15 c++头文件不能识别CDialog
  • ¥15 Excel发现不可读取的内容
  • ¥15 关于#stm32#的问题:CANOpen的PDO同步传输问题