jquery自动加载更多不在ie 8上工作

jquery自动加载更多不在ie 8上工作,jquery,internet-explorer,Jquery,Internet Explorer,当用户滚动到页面底部时,我在html页面中使用此代码加载更多数据 if($(window).scrollTop() + $(window).height() == $(document).height()) //user scrolled to bottom of the page? 我也试过: if($(window).scrollTop() + $(window).innerHeight() == $(document).innerHeight()) //user scrolled t

当用户滚动到页面底部时,我在html页面中使用此代码加载更多数据

if($(window).scrollTop() + $(window).height() == $(document).height())  //user scrolled to bottom of the page?
我也试过:

if($(window).scrollTop() + $(window).innerHeight() == $(document).innerHeight())  //user scrolled to bottom of the page?
我现在不知道ie8到底出了什么问题,但它不起作用。有办法让它运行吗

更新 问题似乎来自.scrolltop()。我在web上找到一个代码,并将其替换为以下内容:

var sTop = document.body.scrollTop || document.documentElement.scrollTop || window.pageYOffset || 0;
if(sTop + $(window).height() == $(document).height())  //user scrolled to bottom of the page?

它起作用了,但我不知道第一行,只是复制了它。这是标准吗?可以使用它吗?

IE8?你是认真的吗?我很抱歉,兄弟:-(您真的需要支持IE8吗?Microsoft将于2016年1月12日停止支持IE8。大多数web开发人员不再支持IE8,除非出于某些特定原因需要。我知道您使用的是jQuery,但这个问题的答案可能会为您指明正确的方向:您是否调试并发现了问题所在?
console.log($(窗口).scrollTop(),$(window).height(),$(document).height());
我确信您的顶行在真正的web浏览器中可以工作。IE 8太旧,太不符合标准。