To load data while scrolling through a page using a function like this
$(window).scroll(function(){ if ($(window).scrollTop() == $(document).height() - $(window).height()) {
Function
get_summary_details() works fine when the page scrolls down. This function is similar to this.
function get_summary_details() { var dataString=[]; $('div.company_summary_data').each(function() { var id = $(this).attr('id'); dataString.push(id); }); $.ajax({ url:"getajaxcompanysummarydetails", type:"POST",
My problem
- while
get_summary_details() processing the request. The user will go to the top page and Scroll down, this get_summary_details() function will be executed again.
How to prevent this Second request processing without completing the first request. Is it possible? Because of this, I get duplicate data records. I need to prevent the display of duplicate entries.
Thanks!
source share