I'm implementing a functionality to bring data like the post's mural of facebook, apparently it's not very difficult, however, I have a question and would like to know if anyone has a solution or suggestion for this problem of mine.
The code
$(document).scroll(function(){
if ($(window).scrollTop() + $(window).height() == $(document).height()) {
pesquisar("","");
}
});
In the code above, I have a function that does an ajax execution to return certain data, however, I would like to refresh the page with new data and not repeating them which is what happens to me at the moment. I tried the find ('div') function. Remove () to have a supposed 'update' of data, however, this is horrible, the user loses the reference where the scroll is and ends up returning to the beginning. Would anyone have a better suggestion for adding the information without repeating the content already added?