title: codeigniter pagination via ajax
body: <p>Is it possible to generate <code>CI pagination</code> via <code>ajax</code> sending <code>page numbers</code> through <code>ajax</code> instead of <code>$config['url_segment']</code>. </p>
  
  <pre><code>$(document).on("click",".pagination li a",function(event) {
      event.preventDefault();
      var segment = $(this).attr("data-ci-pagination-page");
      if(!segment){
          segment = 0;
      }
      $.ajax({
              method: "POST",
              url: "&lt;?php echo base_url(); ?&gt;login/function",
              data: {limit: segment}
          }).done(function($data){
              $("#contents").html($data);
          });
  
  });
  </code></pre>
  
  <p>if I pass pagination variables through <code>ajax</code> how can I <code>config</code> them.</p>
  
  <p><img src="https://i.stack.imgur.com/71eGZ.jpg" alt="enter image description here"></p>