Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7929779
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T20:12:07+00:00 2026-06-03T20:12:07+00:00

Well I made an Infinite scroll script, which is performing quite well. But just

  • 0

Well I made an Infinite scroll script, which is performing quite well. But just in Chrome and IE. Unfortunaly it doesn’t perform the sync call on firefox but still hammers the server async… Meaning I get tons of content back which shouldn’t have been requested… As I was googling around and didn’t find a clear solution for my problem so I’ll ask you guys:

var endajax = 0;

$(window).scroll(function(){
    if (endajax == 0)
    {
        if($(window).scrollTop() + $(window).height() > $(document).height() - 405) 
    {
            $('#profilecontent').prepend('<div class="iloader bgtrans padding ui-corner-all" style="position: fixed; bottom: 20px; right: 80px;"><div class="ui-widget-content ui-corner-all padding"><img width="8" src="images/loader.gif" alt="" /> Inhalt wird nachgeladen, bitte einen Moment gedulden</div></div>');
        var firstid = $('.postbox').last().attr('name');    
        var lastid = $('.postid').last().val(); 
        var data = "firstid="+firstid+"&lastid="+lastid+"&uid=<?php echo $profileuser->id; ?>"; 
        setTimeout(function() {
            $('.iloader').remove();
        }, 2000);
        $.ajax({
        url: "modules/users/profile/profileposts.php",
        cache: false,
        type: "POST",
        async: false,
        data: data,
            success: function(data){
                if (data.length != 2) {
                      $('#profileposts').append(data).fadeIn('slow');
                }
                else
                {
                    endajax = 1;
                }                           
            },
        });
    }
}
});
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T20:12:09+00:00Added an answer on June 3, 2026 at 8:12 pm

    Perhaps lock your semaphore before the ajax call?

    if($(window).scrollTop() + $(window).height() > $(document).height() - 405) 
    {
     endajax++;
    

    and then

    success: function(data){
                if (data.length != 2) {
                      endajax = 0;//or 1 depending on how you are locking this control out
                      $('#profileposts').append(data).fadeIn('slow');
                }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

well, I just made such a hello world non-Flex app in FlashDevelop and packaged
So I am making a form, well I've made it and it works... but
I made a little site for car renting,but i dont understand very well javascript.
I'm well-versed in HMTL/CSS but lean heavily on ready-made jQuery solutions to accomplish some
I made a script to manipulate the appearance of notes in my theme, which
Well I just made a question asking how to simply ~(i + -1) <
I made this loader which actually works pretty well. I now want to make
following this link http://www.codeproject.com/KB/cs/MDITabBrowsing.aspx I made MDI and things are working well. But I
I made a facebook app (well it's not done yet, but most of the
I made an FPS game with MSVC++ which is running very well on Windows.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.