I try to code a loadmore Script.. But connected with a Database means onPage load its showing the first 20 Posts... Then at Page complete scrolling down or clicking the loadmore Button after at bottom of Page its loading the next 20 Posts.
But at the moment its showing everytime the same Posts and its only working with the Button onclick.
So what is the right way ? Or what i must change ?
Thanks for all Hints.
I use atm a 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 to show.</center>');
}
}
});
});
});
</script>