I am currently making a website. Basically when the user scrolls to the bottom of the screen I am going to download another 10 posts (I’m making a little social network). To do this I have downloaded JQuery. The following JavaScript is ran when the user scrolls to the bottom of the page:
page++;
var next = 'posts?page=' + page;
$('.pContainer').append("code that loads the servlet in the next var goes here");
Inside the posts servlet I have a few out.println statements to test this. I have tried using JSP: Include tags inside the append brackets but it does not work.
Have you tried to use an ajax call?
This requests a page and appends the data returned from the page.
Documentation: http://api.jquery.com/jQuery.get/