The 1.php file should output this:
<div id="content">
</div>
<script type="text/javascript">
$(document).ready(function() {
$(window).scroll(function()
{
if ($(window).scrollTop() == $(document).height() - $(window).height())
{
$.get("2.php",function(data) {
$("#content").append(data);
},'html');
}
});
});
</script>
If you want to send the iteration number to 2.php, you can remember it in some hidden input and send it as an argument to $ .get ().
Hope this helps.
source
share