Loadmore Script Php / Javascript? -


i try code loadmore script.. connected database means onpage load showing first 20 posts... @ page complete scrolling down or clicking loadmore button after @ bottom of page loading next 20 posts.

but @ moment showing everytime same posts , working button onclick.

so right way ? or must change ?

thanks hints.

i use atm simple ajax request.

<script type="text/javascript"> $(document).ready(function(){  $( ".readmore_home_posts" ).click(function() {              $('div#loadmoreajaxloader').show();                 $.ajax({                     url: "./ajax/loadmore_homenews.php",                     success: function(html){                         if(html){                             $("#lastpostsloader").append(html);                         } else{                             $('#lastpostsloader').html('<center>no more posts show.</center>');                         }                     }                 });  }); }); </script> 

you haven't done tell database records load, load same records. can remedy using sort of counter , passing counter number loadmore_homenews.php page part of data or $_get var,

url: "./ajax/loadmore_homenews.php?counter=" + counter 

then use counter var part of db query, limiting rows selected based on counter.


Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -