title: Pagination-like in jquery/ajax
body: <p>I try to make systeme like paginate in jquery/ajax. When i push the boutton view more i show the 5 next result</p>
  
  <pre><code>&lt;button class="btn" id="showFiveNext"&gt;View more&lt;/button&gt;
  </code></pre>
  
  <p>But i dont know how do this. Its possible to set in ajax a new clause LIMIT whith offset in my first methode or i have to make a calcul whith a counter for show/hide somes element?</p>
  
  <p>I get my element whit this method</p>
  
  <pre><code>function getVideoComment($idVideo)
  {
      $q = $this-&gt;db-&gt;select('*')-&gt;from('users_youtube_videos_comment uyvc')
          -&gt;join('users_youtube_videos uyv', 'uyv.users_youtube_videos_id = uyvc.users_youtube_videos_id', 'left')
          -&gt;join('users u', 'u.users_id_nat = uyv.users_youtube_videos_id_user', 'left')
          -&gt;join('users_profils up', 'up.users_profils_id = u.users_id_nat', 'left')
          -&gt;order_by('uyvc.users_youtube_videos_comment_id', 'DESC')
          -&gt;limit('5')
          -&gt;where('uyvc.users_youtube_videos_id', $idVideo)
          -&gt;get();
      if($q-&gt;num_rows()&gt;0)
      {
          foreach($q-&gt;result() as $row)
          {
              $data[] = $row;
          }
          return $data;
      }
  }
  </code></pre>
  
  <p>and i count whith this method</p>
  
  <pre><code> function getCountComment($idVideo)
  {
     $q = $this-&gt;db-&gt;select('count(users_youtube_videos_comment.users_youtube_videos_comment_id) AS commentCount')
         -&gt;from('users_youtube_videos_comment')
         -&gt;where('users_youtube_videos_comment.users_youtube_videos_id', $idVideo)
         -&gt;get();
      if($q-&gt;num_rows()&gt;0)
      {
          foreach($q-&gt;result() as $row)
          {
              $data[] = $row;
          }
          return $data;
      }
  }
  </code></pre>
  
  <p>I show the result whith this ajax request </p>
  
  <pre><code>function getComment(){
          var videoId = '&lt;?php echo $idVideo ?&gt;';
          jQuery.ajax({
              type: "GET",
              url: "&lt;?php echo base_url(); ?&gt;video/getVideoComment?videoid=" +videoId,
              dataType: 'json',
  
              success: function(resGetVideoCom){
  
                  $('#showVideoComm').empty();
  
                  $.each(resGetVideoCom,function(key, value){
  
                      var avatarUser = '&lt;img class="img-circle" src=" '+value.users_youtube_avatar_channel+' " height="52" alt="avatar user" &gt;';                   
                      var pseudoUser = '&lt;span class="pseudoComment"&gt;'+value.users_youtube_pseudo_channel+'&lt;/span&gt;';           
                      var commentDate = '&lt;span class="dateComment"&gt; '+value.users_youtube_videos_comment_date+'&lt;/span&gt;&lt;br&gt;';
                      var commentValue = '&lt;div class="valueComment"&gt;'+value.users_youtube_videos_comment_com+'&lt;/div&gt;&lt;br&gt;&lt;br&gt;';
  
                      $('#showVideoComm').append(
  
                          avatarUser+
                          pseudoUser+
                          commentDate+
                          commentValue
  
                      );
                  });
              },
              error:function(resGetVideoCom){
  
              }
          });
      }
  </code></pre>
  
  <p>and the counter </p>
  
  <pre><code>function getCountComment(){
          var videoId = '&lt;?php echo $idVideo ?&gt;';
          jQuery.ajax({
              type: "GET",
              url: "&lt;?php echo base_url(); ?&gt;video/getCountComment?videoid=" +videoId,
              dataType: 'json',
              success: function(resGetCountComment){
                  $('#showCountVideoComm').empty();
  
                  $.each(resGetCountComment,function(key, value){
                      var counterCom = '&lt;span&gt;'+value.commentCount+' commentaires&lt;/span&gt;';
                      $('#showCountVideoComm').append(
  
                          counterCom
  
                      ).hide().fadeIn("slow");
                  });
              },
              error:function(resGetCountComment){
  
              }
          });
      }
  </code></pre>
  
  <p>thanks for your help and sorry for my english.</p>