2012-05-13 20 views
2

まあ、私は非常にうまくいっている無限のスクロールスクリプトを作った。しかし、ChromeとIEだけです。 UnfortunalyそれはFirefoxでの同期呼び出しを実行しませんが、サーバーの非同期をハンマーしています...意味私は要求されてはならないはずのはずのコンテンツのトンを得る...私はグーグルグーグルで、私の問題のためにあなたに聞いてみましょう:FirefoxのJQuery SYNC Ajax呼び出しエラー

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; 
       }       
      }, 
     }); 
    } 
} 
}); 

答えて

0

おそらく、あなたのセマフォをajax呼び出しの前にロックするのでしょうか?

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

、その後

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

ハズレはunfortunalyものは変更されません...しかし、私はそれを考えを与えたと私はPHPとにかくxDさんとのより良いだと、おそらくそれを解決しようとするserversided .. –

+1

@IvanSchrecklich - これは役に立たないと申し訳ありません。幸運のサーバー側! :) –