Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<script type="text/javascript">
$(document).ready(function(){
var start = 0;
$.ajax({
type : "GET",
url : "get_data.php",
data : {
'offset' : 0,
'limit' : 5
},
success: function(data){
$('.post').append(data);
start += 5;
}
});
$(window).scroll(function(){
if($(window).scrollTop() >= $(document).height() - $(window).height()){
$.ajax({
type : "GET",
url : "get_data.php",
data : {
'offset' : start,
'limit' : 5
},
success: function(data){
$('.post').append(data);
start += 5;
}
});
}
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.