How to setup next page loading on reaching the bottom of page..

0 Deep Dhaliwal · September 3, 2014
can anyone tell me how can i setup automaticly next page page content loading via ajax  when user  reaches bottom of current page..for  example this feature is used in Facebook & buckysroom for news feeds/posts....

Post a Reply


Oldest  Newest  Rating
+2 JOhaL jaTT · September 3, 2014
Are you talking about this  >>>>>Test this in your browser 

<script type="text/javascript">
function yHandler(){

var wrap = document.getElementById('wrap');

var contentHeight = wrap.offsetHeight;

var yOffset = window.pageYOffset; 

var y = yOffset + window.innerHeight;

if(y >= contentHeight){
// Ajax call to get more dynamic data goes here
window.location.href = '';

window.onscroll = yHandler;
<style type="text/css">

div#wrap{width:800px; height:1250px;margin:0px auto;background-color:#545453;}


<div id="wrap"></div>
0 Nikola Novakovic · September 21, 2014
This code can be put in a pretty good use :)
0 Deep Dhaliwal · September 16, 2014
thanks a lot bai..i gonna try this.
  • 1



A scripting language that is added to standard HTML to create interactive effects, apps, games for the browser.