jQuery AJAX脚本在Firefox中不起作用


jQuery AJAX-script not working in Firefox

我不明白为什么这个脚本在Firefox中不起作用。而且,即使我的ajax_loadmore.php输出FALSE,它仍然进行AJAX调用(在Chrome中)。

var request;
$(window).scroll(function () {
   if ($(window).scrollTop() == $(document).height() - $(window).height() ) {
      var ID = $('.stbody:last').attr('id').match(/stbody('d+)/)[1];
      $('#loader').show();
      if(request) {
        return
      }
      request = $.ajax({
        type: 'GET',
        url: "ajax_loadmore.php?lCom="+ID,
        success: function(result) {
            if(result!='FALSE') {
                $('#loader').hide();
                $('#moreComments').append(result);
                $(".oembed").oembed(null, {
                    embedMethod: "fill",
                    maxWidth: 700,
                    maxHeight: 600
                });
                request = null;
            } else {
                $('#loader').hide();
                $('#moreComments').html('<center><p>Slut på inlägg</p></center>');
                request = null;
            }
        }
      }); 
   }
});

ajax_loadmore.php代码:

<?php
if($_GET['lCom']) {
  include_once 'core/init.php';
  protect_page();
  include_once 'includes/db.php';
  include_once 'includes/functions.php';
  include_once 'includes/tolink.php';
  include_once 'includes/time_stamp.php';
  include_once 'session.php';
  $lCom = $_GET['lCom'];
  $Wall = new Wall_Updates();
  $updatesarray=$Wall->Updates_more($uid,$lCom);
  if(!empty($updatesarray)) {
    foreach($updatesarray as $data) {
      $msg_id=$data['msg_id'];
      $orimessage=$data['message'];
      $message=tolink(htmlspecialchars(nl2br($data['message'])));
      $time=$data['created'];
      $username=$data['username'];
      $uid=$data['uid_fk'];
      $face=get_profile_pic($uid,'small');
      $face2=get_profile_pic($session_user_id,'mini'); 
      $commentsarray=$Wall->Comments($msg_id);
      ?>
        //HTMLSTUFF HERE.. 
      <?php
      }
  } else { echo 'FALSE'; }
} else { die('du ska inte vara här..'); }
?>

我也遇到了同样的问题,我使用了以下链接中的脚本:

http://www.9lessons.info/2009/07/load-data-while-scroll-with-jquery-php.html

现在似乎可以工作了。当菜单到达顶部时,我使用jQuery将粘性类添加到菜单中。菜单上有一个位置:相对位置,它可能会打乱窗口的高度或其他什么,所以Firefox没有执行脚本,因为它没有到达底部。

当我将菜单容器上的position:relative更改为position:absolute时,它就起作用了。

如果有人能更详细地解释为什么会这样,我会很高兴!(因为它在Chrome和IE中工作,我猜这是Firefox中的渲染问题)

谢谢你的回复!